Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Trento Container Installation Instructions #182

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions trento/migration/container-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Follow the steps in [4.2 systemd deployment](https://documentation.suse.com/sles

### Install Docker container runtime

1. Enable the container`s module:
1. Enable the containers module:

```bash
SUSEConnect --product sle-module-containers/15.5/x86_64
```

> **Note:** Using a different Service Pack than SP5 requires to change repository: [SLE15 SP3: `SUSEConnect --product sle-module-containers/15.3/x86_64`,SLE15 SP4: ` SUSEConnect --product sle-module-containers/15.4/x86_64`]
> **Note:** Using a different Service Pack than SP5 requires to change repository: [SLE15 SP3: `SUSEConnect --product sle-module-containers/15.3/x86_64`,SLE15 SP4: `SUSEConnect --product sle-module-containers/15.4/x86_64`]

1. Install Docker:

Expand All @@ -36,12 +36,12 @@ Follow the steps in [4.2 systemd deployment](https://documentation.suse.com/sles
docker network create trento-net
```

> **Note:** When creating the trento-net network, Docker typically assigns a default subnet: `172.17.0.0/16`. Ensure that this subnet matches the one specified in your PostgreSQL configuration file (refer to`/var/lib/pgsql/data/pg_hba.conf`). If the subnet of `trento-net` differs from `172.17.0.0/16` then adjust `pg_hba.conf` and restart PostgreSQL.
> **Note:** When creating the `trento-net` network, Docker normally assigns a default subnet: `172.17.0.0/16`. Ensure that this subnet is allowed by the rules specified in your PostgreSQL configuration file. For more information, please refer to upstream's [`pg_hba.conf`](https://www.postgresql.org/docs/current/auth-pg-hba-conf.html) documentation.

1. Verify the subnet of trento-net:
1. Verify the subnet of `trento-net`:

```bash
docker network inspect trento-net --format '{{range .IPAM.Config}}{{.Subnet}}{{end}}'
docker network inspect trento-net --format '{{range .IPAM.Config}}{{.Subnet}}{{end}}'
```

Expected output:
Expand All @@ -63,25 +63,35 @@ Follow the steps in [4.2 systemd deployment](https://documentation.suse.com/sles
REFRESH_TOKEN_ENC_SECRET=$(openssl rand -out /dev/stdout 48 | base64)
```

1. Install trento-wanda on Docker:
1. Install the checks on the system in a shared volume:

```bash
docker volume create trento-checks \
&& docker run \
-v trento-checks:/usr/share/trento/checks \
registry.suse.com/trento/trento-checks:latest
```

1. Deploy trento-wanda:

```bash
docker run -d --name wanda \
-p 4001:4000 \
--network trento-net \
--add-host "host.docker.internal:host-gateway" \
-v trento-checks:/usr/share/trento/checks:ro \
-e CORS_ORIGIN=localhost \
-e SECRET_KEY_BASE=$WANDA_SECRET_KEY_BASE \
-e ACCESS_TOKEN_ENC_SECRET=$ACCESS_TOKEN_ENC_SECRET \
-e AMQP_URL=amqp://trento_user:[email protected]/vhost \
-e DATABASE_URL=ecto://wanda_user:[email protected]/wanda \
--restart always \
--entrypoint /bin/sh \
registry.suse.com/trento/trento-wanda:1.2.0 \
registry.suse.com/trento/trento-wanda:latest \
-c "/app/bin/wanda eval 'Wanda.Release.init()' && /app/bin/wanda start"
```

1. Install trento-web on Docker
1. Deploy trento-web.

Make sure to change the `ADMIN_USER` and `ADMIN_PASSWORD`. These credentials are required to login to the trento-web UI.
Depending on how you intend to connect to the console, a working hostname, FQDN, or an IP is required in `TRENTO_WEB_ORIGIN` for HTTPS otherwise, websockets will fail to connect, causing no real-time updates on the UI.
Expand All @@ -108,7 +118,7 @@ Follow the steps in [4.2 systemd deployment](https://documentation.suse.com/sles
-e TRENTO_WEB_ORIGIN='trento.example.com' \
--restart always \
--entrypoint /bin/sh \
registry.suse.com/trento/trento-web:2.2.0 \
registry.suse.com/trento/trento-web:latest \
-c "/app/bin/trento eval 'Trento.Release.init()' && /app/bin/trento start"
```

Expand Down Expand Up @@ -147,4 +157,4 @@ Follow the steps in [4.2 systemd deployment](https://documentation.suse.com/sles
e859c07888ca registry.suse.com/trento/trento-wanda:1.2.0 "/bin/sh -c '/app/bi…" 18 seconds ago Up 16 seconds 0.0.0.0:4001->4000/tcp, :::4001->4000/tcp wanda
```

Both containers should be running and listening on the specified ports.
Both containers must run and listen on the specified ports.
36 changes: 23 additions & 13 deletions trento/xml/container-install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<procedure>
<step>
<para>
Enable the Container module:
Enable the containers module:
</para>
<programlisting language="bash">
SUSEConnect --product sle-module-containers/15.5/x86_64
Expand Down Expand Up @@ -60,21 +60,19 @@ docker network create trento-net
</programlisting>
<note>
<para>
When creating the trento-net network, Docker assigns a default subnet:
<literal>172.17.0.0/16</literal>. Ensure that this subnet matches the one specified
in your PostgreSQL configuration file (refer
to<filename>/var/lib/pgsql/data/pg_hba.conf</filename>). If the subnet of
<literal>trento-net</literal> differs from <literal>172.17.0.0/16</literal> then
adjust <literal>pg_hba.conf</literal> and restart PostgreSQL.
When creating the <literal>trento-net</literal> network, Docker assigns a default subnet to it:
<literal>172.17.0.0/16</literal>. Ensure that this subnet is allowed by the rules specified
in your PostgreSQL configuration. For more information, refer to the upstream
<link xlink:href="https://www.postgresql.org/docs/current/auth-pg-hba-conf.html"><literal>pg_hba.conf</literal></link> documentation.
</para>
</note>
</step>
<step>
<para>
Verify the subnet of trento-net:
Verify the subnet of <literal>trento-net</literal>:
</para>
<programlisting language="bash">
docker network inspect trento-net --format '{{range .IPAM.Config}}{{.Subnet}}{{end}}'
docker network inspect trento-net --format '{{range .IPAM.Config}}{{.Subnet}}{{end}}'
</programlisting>
<para>
Expected output is as follows:
Expand All @@ -97,14 +95,25 @@ docker network inspect trento-net --format '{{range .IPAM.Config}}{{.Subnet}}{{
Consider using an environment variable file (see
<link xlink:href="https://docs.docker.com/engine/reference/commandline/run/#env">official
Docker documentation</link>). Adjust the docker command below for use with the env file. In any case, make sure you keep a copy of the generated keys in a safe location, in case you need to
reuse them in the future.
reuse them in the future.
</para>
</note>
<programlisting language="bash">
WANDA_SECRET_KEY_BASE=$(openssl rand -out /dev/stdout 48 | base64)
TRENTO_SECRET_KEY_BASE=$(openssl rand -out /dev/stdout 48 | base64)
ACCESS_TOKEN_ENC_SECRET=$(openssl rand -out /dev/stdout 48 | base64)
REFRESH_TOKEN_ENC_SECRET=$(openssl rand -out /dev/stdout 48 | base64)
</programlisting>
</step>
<step>
<para>
Install the checks on the system in a shared volume:
</para>
<programlisting language="bash">
docker volume create trento-checks \
&amp;&amp; docker run \
-v trento-checks:/usr/share/trento/checks \
registry.suse.com/trento/trento-checks:latest
</programlisting>
</step>
<step>
Expand All @@ -116,14 +125,15 @@ docker run -d --name wanda \
-p 4001:4000 \
--network trento-net \
--add-host &quot;host.docker.internal:host-gateway&quot; \
-v trento-checks:/usr/share/trento/checks:ro \
-e CORS_ORIGIN=localhost \
-e SECRET_KEY_BASE=$WANDA_SECRET_KEY_BASE \
-e ACCESS_TOKEN_ENC_SECRET=$ACCESS_TOKEN_ENC_SECRET \
-e AMQP_URL=amqp://trento_user:[email protected]/vhost \
-e DATABASE_URL=ecto://wanda_user:[email protected]/wanda \
--restart always \
--entrypoint /bin/sh \
registry.suse.com/trento/trento-wanda:1.2.0 \
registry.suse.com/trento/trento-wanda:latest \
-c &quot;/app/bin/wanda eval 'Wanda.Release.init()' &amp;&amp; /app/bin/wanda start&quot;
</programlisting>
</step>
Expand Down Expand Up @@ -164,7 +174,7 @@ docker run -d \
-e TRENTO_WEB_ORIGIN='trento.example.com' \
--restart always \
--entrypoint /bin/sh \
registry.suse.com/trento/trento-web:2.2.0 \
registry.suse.com/trento/trento-web:latest \
-c &quot;/app/bin/trento eval 'Trento.Release.init()' &amp;&amp; /app/bin/trento start&quot;
</programlisting>
<para>
Expand Down Expand Up @@ -210,7 +220,7 @@ CONTAINER ID IMAGE COMMAND
e859c07888ca registry.suse.com/trento/trento-wanda:1.2.0 &quot;/bin/sh -c '/app/bi…&quot; 18 seconds ago Up 16 seconds 0.0.0.0:4001-&gt;4000/tcp, :::4001-&gt;4000/tcp wanda
</programlisting>
<para>
Both containers should be running and listening on the specified ports.
Both containers must run and listen on the specified ports.
</para>
</step>
</procedure>
Expand Down
Loading