Maintenance

3 minute read

The IPSL Boundary Condtion Editor is developped on GitHub and automatically deployed to https://climate_sim.osupytheas.fr.

General Maintenance

Get access to the containers

  1. Navigate to Portainer
  2. Use your OSU login details.
  3. Click on dev: Portainer home
  4. Click on Stacks: Portainer dev
  5. At this step, you can either clic on the:
    • netcdf stack name which is the Single Page
    • climsim stack name which is the Multi Page
    For the rest of the section we will use the climsim stack but it is identical for the netcdf stack except there will be only one container.

    Click on climsim: Portainer stacks

  6. Stack details and list of containers will be displayed: Portainer Containers

  7. For each container, you have access to several options under the Quick Actions column: Portainer Quick Action
    1. log of the container

    2. informations about the container

    3. resource usage of the container

    4. console inside the container

Managing containers

You can perfom several actions over one or multiple containers.

For this, select them by ticking the box on the left side and then selecting the action you want to perform. Portainer Restart

What you might need the most will be the action to redeploy a container in case it doesn't work properly.

Redeploying the Stack

This can be necessary after a power cut for example or if you accidentally removed a container.

  1. Once you are on the stack details and container list page (step 6 of Get access to the containers)
  2. Click on Editor: Portainer Editor

  3. The docker-compose will be displayed here (You might need to do some changes in it): Portainer Update Stack

  4. Click Update the stack (this will repull all the images and redeploy all containers): Portainer Update Stack

  5. A box will appear asking you to confirm. Tick the Re-pull image and redeploy box and click Update button.

Database management

At some point you might need to reach the application database. The steps below describe how get access and somme useful commands.

Access to the console of climsim_flask_app_1 container (step 7 of Get access to the containers). Once in the console use the commands

apt-get update
apt-get install sqlite3

Go to the instance folder:

cd /usr/src/app/instance

You can access the db by using the command:

sqlite3 netcdf_editor.sqlite

You can list the tables available in the db with:

.tables

To display all the content of table, use:

select * from [TABLE];

With [TABLE] the table name you want to look at.

Other commands can be found on the official Sqlite website.

Process queue management

Access to the console of climsim_message_broker_1 container (step 7 of Get access to the containers). Once in the console use the following commands to list the available queues:

rabbitmqadmin list queues

To see the processes in a specific queue, use:

rabbitmqadmin get queue=[QUEUE_NAME] count=40 

[QUEUE_NAME] can be found using command to list queues available.

More information can be found on the offcial rabbitmq website.

Images hosting

You may need to read more about the deployment workflow as it is complementary to this section.

Each time new images are generated by Github actions, they are pushed to the Osupytheas registry and DockerHub.

On GitHub, the file responsible for the creation of the images and their deployment (to DockerHub and Osupytheas registry) is docker-image.yml.

DockerHub

Images are pushed to DockerHub (https://hub.docker.com/) with only a tag latest.

GitHub action is able to push images to DockerHub thanks to a DockerHub account which is a member of the CEREGE-CL DockerHub organization (See the several command lines docker login -u $DOCKER_USER -p $DOCKER_PASSWORD in docker-image.yml).

In order to work this way, the DockerHub account credentials must be provided in the GitHub Actions Secrets. The two concerned secrets are DOCKER_USER and DOCKER_PASSWORD.

If you want to modify them, clic on update secret button: Portainer Editor

Instead of providing the account password, an access token in DockerHub can be used. It works like a password but you can have many tokens and revoke access to each one at any time. For this, connect to your DockerHub account and go into your Account Settings and into the Security tab.
From there, you can generate a new access token and provide it for the DOCKER_PASSWORD secret in GitHub.
Do not modify the DOCKER_USER_OSU and the DOCKER_PASSWORD_OSU secrets unless requested by the SIP.
For now:
DOCKER_USER = anthog
DOCKER_PASSWORD = anthog Access token

registry.osupytheas.fr

You must be connected to internet via ethernet cable at CEREGE or at the vpn.osupytheas.fr in order to reach the registry.

Images are pushed to the Osupytheas registry (https://docker.osupytheas.fr/) with a tag latest and a tag with the GitHub commit number.

When you reach the registry page, you can look for the netcdf_editor_... images:

[Visual explanation]

Clic on one of the images to get more information:

[Visual explanation]

Updated: