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 14 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
26 changes: 18 additions & 8 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,21 +63,31 @@ 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 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. Install trento-wanda on Docker:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence sounds weird: you can't install something on Docker. Do you mean something like, Run trento-wanda in a Docker container?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmpop I am not familiar enough with Docker to argue otherwise. If you think your suggestion is more accurate, then go for it.


```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"
```

Expand All @@ -103,12 +113,12 @@ Follow the steps in [4.2 systemd deployment](https://documentation.suse.com/sles
-e ACCESS_TOKEN_ENC_SECRET=$ACCESS_TOKEN_ENC_SECRET \
-e REFRESH_TOKEN_ENC_SECRET=$REFRESH_TOKEN_ENC_SECRET \
-e ADMIN_USERNAME='admin' \
-e ADMIN_PASSWORD='test1234' \
-e ADMIN_PASSWORD='test1357' \
-e ENABLE_API_KEY='true' \
-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
34 changes: 22 additions & 12 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 Down Expand Up @@ -104,6 +102,17 @@ 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 @@ -115,14 +124,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 @@ -158,12 +168,12 @@ docker run -d \
-e ACCESS_TOKEN_ENC_SECRET=$ACCESS_TOKEN_ENC_SECRET \
-e REFRESH_TOKEN_ENC_SECRET=$REFRESH_TOKEN_ENC_SECRET \
-e ADMIN_USERNAME='admin' \
-e ADMIN_PASSWORD='test1234' \
-e ADMIN_PASSWORD='test1357' \
-e ENABLE_API_KEY='true' \
-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
Loading