Operations grimoire/Penpot: Difference between revisions

From Nasqueron Agora
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
Penpot allows to experiment with UX, design and prototypes. It's hosted on our Docker PaaS.
Penpot allows to experiment with UX, design and prototypes. It's hosted on our Docker PaaS.
This is a product under evaluation, feedback can be added to {{T|1703}}.
== Howto ==
=== Upgrade ===
There are two things to know:
* We pull 3 images, run 2 of them as container, the last one - frontend - is only used to copy resources to our main nginx
* The frontend and backend versions must match
'''Step 1 - Front-end preparation'''
First step is to update front-end at https://artifacts.nasqueron.org/penpot/penpot.tar.gz
On Dwellers:
# Pull the front-end image: <code>docker pull penpotapp/frontend</code>
# Spawn a new container with <code>docker run --rm -it penpotapp/frontend bash</code>
# Archive the /var/www/app folder: <code>cd /var/www && tar czf penpot.tar.gz app/</code>
# Copy it to the artifacts.nasqueron.org penpot folder: <code>docker cp <penpot container>:/var/www/penpot.tar.gz /srv/artifacts/penpot/</code>
'''Step 2 - Back-end and exporter'''
On docker-002:
# Pull the images <code>penpotapp/exporter</code>, <code>penpotapp/frontend</code> and <code>penpotapp/backend</code>
# Delete the file Salt uses to know front-end is deployed: <code>rm /srv/penpot/public/version.txt</code>
# Deploy the service with <code>deploy_container penpot_exporter</code> and <code>deploy-container penpot_web</code>
'''To check migrations'''
On docker-002, you should wee with <code>docker logs penpot_web</code> something like:
<syntaxhighlight>
[2024-01-17 23:50:57.865] I app.db - hint="initialize connection pool", name="main", uri="postgresql://penpot_db/penpot", read-only=false, with-credentials=true, min-size=0, max-size=60
[2024-01-17 23:50:57.892] I app.migrations - hint="running migrations", module=:app.migrations/migrations
[2024-01-17 23:50:58.123] I app.util.migrations - action="apply migration", module="main", name="0102-mod-access-token-table"
[2024-01-17 23:50:58.180] I app.util.migrations - action="apply migration", module="main", name="0103-mod-file-object-thumbnail-table"
[2024-01-17 23:50:58.345] I app.util.migrations - action="apply migration", module="main", name="0104-mod-file-thumbnail-table"
[2024-01-17 23:50:58.349] I app.util.migrations - action="apply migration", module="main", name="0105-mod-server-error-report-table"
</syntaxhighlight>


== Troubleshoot ==
== Troubleshoot ==
Line 10: Line 49:
* Front-end: `cat /srv/penpot/public/version.txt`
* Front-end: `cat /srv/penpot/public/version.txt`
* Back-end: `docker exec penpot_web cat version.txt`
* Back-end: `docker exec penpot_web cat version.txt`
To ask Salt to redeploy front-end on docker-002:
    rm /srv/penpot/public/version.txt
    deploy-container penpot_web
=== Front-end can't find resources ===
Ensure nginx configuration is still up-to-date by comparing {{Ops file|roles/paas-docker/nginx/files/vhosts/penpot_web.conf}} and <code>/etc/nginx/nginx.conf</code> in the container. Container can be run with <code>docker run --rm -it penpotapp/frontend bash</code>.
Deploy with <code>salt docker-002 state.sls_id /etc/nginx/vhosts/penpot_web/penpot_web.conf roles/paas-docker/nginx</code>.

Latest revision as of 00:54, 18 January 2024

Penpot allows to experiment with UX, design and prototypes. It's hosted on our Docker PaaS.

This is a product under evaluation, feedback can be added to T1703.

Howto

Upgrade

There are two things to know:

  • We pull 3 images, run 2 of them as container, the last one - frontend - is only used to copy resources to our main nginx
  • The frontend and backend versions must match

Step 1 - Front-end preparation

First step is to update front-end at https://artifacts.nasqueron.org/penpot/penpot.tar.gz

On Dwellers:

  1. Pull the front-end image: docker pull penpotapp/frontend
  2. Spawn a new container with docker run --rm -it penpotapp/frontend bash
  3. Archive the /var/www/app folder: cd /var/www && tar czf penpot.tar.gz app/
  4. Copy it to the artifacts.nasqueron.org penpot folder: docker cp <penpot container>:/var/www/penpot.tar.gz /srv/artifacts/penpot/

Step 2 - Back-end and exporter

On docker-002:

  1. Pull the images penpotapp/exporter, penpotapp/frontend and penpotapp/backend
  2. Delete the file Salt uses to know front-end is deployed: rm /srv/penpot/public/version.txt
  3. Deploy the service with deploy_container penpot_exporter and deploy-container penpot_web

To check migrations

On docker-002, you should wee with docker logs penpot_web something like:

[2024-01-17 23:50:57.865] I app.db - hint="initialize connection pool", name="main", uri="postgresql://penpot_db/penpot", read-only=false, with-credentials=true, min-size=0, max-size=60
[2024-01-17 23:50:57.892] I app.migrations - hint="running migrations", module=:app.migrations/migrations
[2024-01-17 23:50:58.123] I app.util.migrations - action="apply migration", module="main", name="0102-mod-access-token-table"
[2024-01-17 23:50:58.180] I app.util.migrations - action="apply migration", module="main", name="0103-mod-file-object-thumbnail-table"
[2024-01-17 23:50:58.345] I app.util.migrations - action="apply migration", module="main", name="0104-mod-file-thumbnail-table"
[2024-01-17 23:50:58.349] I app.util.migrations - action="apply migration", module="main", name="0105-mod-server-error-report-table"

Troubleshoot

PostgreSQL

You can open a PostgreSQL console with docker exec -it penpot_db psql -U penpot.

Front-end vs back-end version

Versions for back-end and front-end need to match, especially as Penpot is developed with a rather fast pace.

  • Front-end: `cat /srv/penpot/public/version.txt`
  • Back-end: `docker exec penpot_web cat version.txt`

To ask Salt to redeploy front-end on docker-002:

   rm /srv/penpot/public/version.txt
   deploy-container penpot_web

Front-end can't find resources

Ensure nginx configuration is still up-to-date by comparing rOPS: roles/paas-docker/nginx/files/vhosts/penpot_web.conf and /etc/nginx/nginx.conf in the container. Container can be run with docker run --rm -it penpotapp/frontend bash.

Deploy with salt docker-002 state.sls_id /etc/nginx/vhosts/penpot_web/penpot_web.conf roles/paas-docker/nginx.