Skip to content

fix orion environment not working#4857

Merged
mnaamani merged 7 commits intoJoystream:masterfrom
dobertRowneySr:docker-compose-orion
Sep 14, 2023
Merged

fix orion environment not working#4857
mnaamani merged 7 commits intoJoystream:masterfrom
dobertRowneySr:docker-compose-orion

Conversation

@dobertRowneySr
Copy link
Copy Markdown
Collaborator

@dobertRowneySr dobertRowneySr commented Sep 6, 2023

Fixes the current orion environment not working when starting the playground
I have also removed the squid-archive services in favour of our new archive endpoint

Fixes the current orion environment not working.
I have also removed the squid-archive services in favour of our new
endpoint `https://archive.joystream.org/graphql`
Copy link
Copy Markdown
Member

@mnaamani mnaamani left a comment

Choose a reason for hiding this comment

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

Works well, but the default archive gateway on startup is the production chain which doesn't make sense. I think we should keep an archive + gateway in the setup. If we choose to run orion from this repo for the production chain then we set the CUSTOM_ARCHIVE_GATEWAY_URL env variable to https://archive.joystream.org/graphql

TRUSTED_REVERSE_PROXIES=1
SESSION_EXPIRY_AFTER_INACTIVITY_MINUTES=60
SESSION_MAX_DURATION_HOURS=720
EMAIL_CONFIRMATION_ROUTE=http://localhost:4074/api/v1/confirm-email?token={token}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

obviously this will only work when opening email from the machine. But I gather we would most likely disable email confirmation and notifications in a playground setup so thats fine.

@mnaamani
Copy link
Copy Markdown
Member

mnaamani commented Sep 7, 2023

@ignazio-bovo The CI check that is failing:
https://github.com/Joystream/joystream/actions/runs/6099420853/job/16551528071?pr=4857#step:12:16435

because it tries to use the adjacent docker-compose file docker-compose-no-bind-volumes.yml by first copying it over to docker-compose.yml

Please apply the same fixes to that as well.

Copy link
Copy Markdown
Member

@mnaamani mnaamani left a comment

Choose a reason for hiding this comment

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

A couple minor fixes needed of archive explorer config. Otherwise working nicely.

With so env variables now in the .env file and with some similarly named ones, i think in future we need to do a bit of refactoring to make it more manageable.

.env Outdated
TRUST_PROXY=uniquelocal

# Sendgrid API
SENDGRID_API_KEY=
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is an identical SENDGRID_API_KEY variable below for the faucet.
perhaps we can prefix the one for orion with ORION_SENDGRID_API_KEY then pass that env variable in docker-compose environment section (so you don't have to modify orion code to expect a different variable name)

@@ -0,0 +1,4 @@
listen_addresses = '*'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we rename this file to orion-postgres.conf, there is another PR where I was planning to add a postgres.conf file for the query-node db. It makes sense to have two different conf files for each db instance.

- .env
environment:
DB_TYPE: postgres # set to `cockroach` for Cockroach DB
DB_HOST: archive_db
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the hostname is incorrect, (should it be orion_archive_db), also the correct port for the archive db ARCHIVE_DB_PORT is not used here.

I'm seeing connection error log for the explorer container:

2023-09-11 10:54:19 {"level":3,"time":1694415259620,"ns":"sqd:substrate-explorer","msg":"failed to connect to postgres://postgres@archive_db:5432/squid-archive","err":{"errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"archive_db","stack":"Error: getaddrinfo ENOTFOUND archive_db\n    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)"}}
2023-09-11 10:54:19 {"level":2,"time":1694415259730,"ns":"sqd:substrate-explorer","msg":"listening on port 3000"}

Copy link
Copy Markdown
Member

@mnaamani mnaamani left a comment

Choose a reason for hiding this comment

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

You need the DB_PORT also to be set for the explorer, and the renamed postgres.conf file needs to be adjusted in the docker-compose file for the orion-db service to match the new name:

    volumes:
      - orion-db-data:/var/lib/postgresql/data
      - ./orion-postgres.conf:/etc/postgresql/postgresql.conf


# Sendgrid API
ORION_SENDGRID_API_KEY=
ORION_SENDGRID_FROM_EMAIL=gateway@example.com
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These need to be used in docker-compose to pass the expected env var name to orion like so:

environment:
      - SENDGRID_API_KEY=${ORION_SENDGRID_API_KEY}
      - SENDGRID_FROM_EMAIL=${ORION_SENDGRID_FROM_EMAIL}

@mnaamani mnaamani self-requested a review September 14, 2023 04:10
@mnaamani mnaamani merged commit 0d2a068 into Joystream:master Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants