Project:RunImporter: Difference between revisions

From MaRDI portal
Rim (talk | contribs)
mNo edit summary
Rim (talk | contribs)
No edit summary
Line 1: Line 1:
=== Overview ===
=== Overview ===


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


=== Import Locally ===
=== 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 [https://portal.mardi4nfdi.de/wiki/Project:Docker_OpenStackVM here].




=== Import to the staging server ===
=== Import to the staging server ===
# If changes have been made to the script, they need to be pushed and merged to the [https://github.com/MaRDI4NFDI/docker-importer docker-importer] repo so that the docker image includes the changes. Make sure the commits are [https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits signed].
# Trigger the workflow on the [https://github.com/MaRDI4NFDI/srv-mardi03 mardi03 GitHub repo] (instructions are on git). (?)
# Execute the importer script from within the mardi-importer container. To do this, there are two options:
#* '''Executing the script on the mardi03 server''':
#*# connect to mardi03 via ssh <code>shh mardi03</code>
#*# navigate to the portal-compose directory: <code>cd portal-compose</code>
#*# access the importer container: <code>docker exec -it mardi-importer bash</code>
#*# execute the importer script that's in <code>/mardi_importer/mardi_importer/scripts</code>
#* '''Executing the script in [https://portainer.staging.mardi4nfdi.org/#!/auth Portainer]:'''
#*# log in to Portainer (user: admin)
#*# Under 'Environments' click 'local' and then click 'containers' in the side panel on the left
#*# Search for the mardi-importer container
#*# 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.
#*# Click '>_ Console' and 'Connect' to access the container.
#*# execute the importer script that's in <code>/mardi_importer/mardi_importer/scripts</code>


=== Import to the portal ===
=== 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.
# Trigger the workflow on the [https://github.com/MaRDI4NFDI/srv-mardi02 mardi02 GitHub repo].
# Execute the script on the mardi02 server:
## connect to mardi03 via ssh <code>shh mardi02</code>
## navigate to the portal-compose directory: <code>cd portal-compose</code>
## access the importer container: <code>docker exec -it mardi-importer bash</code>
## execute the importer script that's in <code>/mardi_importer/mardi_importer/scripts</code>

Revision as of 18:10, 24 March 2025

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