Operations grimoire/Penpot: Difference between revisions

From Nasqueron Agora
No edit summary
No edit summary
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>
# 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 ==

Revision as of 23:58, 17 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. 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`