Project:RunImporter

From MaRDI portal
Revision as of 18:10, 24 March 2025 by Rim (talk | contribs)

Overview

instructions for how to run the importer locally, on staging, and on the portal

Import Locally

Development, testing, and debugging can be done locally on a virtual machine. Instructions for setting up the VM and connecting to it can be found here.


Import to the staging server

  1. If changes have been made to the script, they need to be pushed and merged to the docker-importer repo so that the docker image includes the changes. Make sure the commits are signed.
  2. Trigger the workflow on the mardi03 GitHub repo (instructions are on git). (?)
  3. Execute the importer script from within the mardi-importer container. To do this, there are two options:
    • Executing the script on the mardi03 server:
      1. connect to mardi03 via ssh shh mardi03
      2. navigate to the portal-compose directory: cd portal-compose
      3. access the importer container: docker exec -it mardi-importer bash
      4. execute the importer script that's in /mardi_importer/mardi_importer/scripts
    • Executing the script in Portainer:
      1. log in to Portainer (user: admin)
      2. Under 'Environments' click 'local' and then click 'containers' in the side panel on the left
      3. Search for the mardi-importer container
      4. If changes have been made to the code, click on "Recreate" with the option to re-pull the image, to pull the latest changes from the docker-importer repo.
      5. Click '>_ Console' and 'Connect' to access the container.
      6. execute the importer script that's in /mardi_importer/mardi_importer/scripts

Import to the portal

It is recommended to have executed a trial run involving any new changes on the staging server before uploading to the main portal. Assuming changes are already merged to the main branch on the docker-importer GitHub repo and included in the mardi-importer container, the execution steps are similar to those above.

  1. Trigger the workflow on the mardi02 GitHub repo.
  2. Execute the script on the mardi02 server:
    1. connect to mardi03 via ssh shh mardi02
    2. navigate to the portal-compose directory: cd portal-compose
    3. access the importer container: docker exec -it mardi-importer bash
    4. execute the importer script that's in /mardi_importer/mardi_importer/scripts