Back

[SOLVED] executor does not deploy openruntimes container with proper network

  • 0
  • Self Hosted
전문트롤러
11 Aug, 2023, 15:17

I'm using docker swarm and deploy compose file with stack. I checked executor container has proper _APP_EXECUTOR_RUNTIME_NETWORK and OPEN_RUNTIMES_NETWORK environment variable. But my openruntimes container does not joined into appwrite_runtimes network automatically.

TL;DR
The user was having an issue where the openruntimes container was not deploying with the proper network in a Docker swarm. The solution to this issue was to manually create the network using the command `docker network create -d overlay --attachable appwrite_runtimes` and then use the external network in the compose file. The compose file should have the following configuration for the networks: ``` networks: runtimes: external: true name: appwrite_runtimes ```
전문트롤러
11 Aug, 2023, 15:25

Solve with following instructions

  1. Create network manually docker network create -d overlay --attachable appwrite_runtimes
  2. Use external network in compose file
TypeScript
networks:
  runtimes:
    external: true
    name: appwrite_runtimes
전문트롤러
11 Aug, 2023, 15:26

When using swarm mode, appwrite_runtimes cannot attachable manually so it missing when create openruntimes container

Binyamin
11 Aug, 2023, 15:26

You'll need to do the networks overlay and attachable

Binyamin
11 Aug, 2023, 15:26
Binyamin
11 Aug, 2023, 15:29

Can you run the

TypeScript
docker network inspect appwrite_runtimes
Binyamin
11 Aug, 2023, 15:29

Also, when deploying Docker swarm the appwrite-executor can't be scaled

Binyamin
11 Aug, 2023, 15:30

You can see at the chapter I've referenced here And here in the note https://book.appread.io/benchmarks#docker-swarm

전문트롤러
11 Aug, 2023, 15:32

Thanks for the link, i will read all of it

Binyamin
11 Aug, 2023, 15:32

👍 Notice that this approach I've wrote use the a decentralizated Database and storeage https://book.appread.io/decentralization

전문트롤러
11 Aug, 2023, 15:35

I think that the compose file in the github will generate containers without any environment variables

전문트롤러
11 Aug, 2023, 15:35

Since swarm mode does not use .env files

Binyamin
11 Aug, 2023, 15:36

It don't use the env_file approach rather a different one Check here https://book.appread.io/docker-swarm#deploying-the-stack

By running this command

TypeScript
export $(grep -v '^#' .env | xargs) && docker stack config -c docker-compose.yml

That will put all the .env variables in the path

Binyamin
11 Aug, 2023, 15:37

So when you're deploying the task it will use all the environment variables

전문트롤러
11 Aug, 2023, 15:40

I used source .env but it was not work. I'm too noob to shell scripting. 😆

Binyamin
11 Aug, 2023, 15:53

Try that approach and let me know if it worked

전문트롤러
11 Aug, 2023, 18:31

Working with export $(...) very interesting

Binyamin
11 Aug, 2023, 18:35

It goes like this

  • grep -v '^#' .env will output all the variables inside the .env file
  • xargs will run the command on export on each of the values.
전문트롤러
11 Aug, 2023, 19:13

And unlike source, export pass values to commands so it still exists while executing docker commands

Binyamin
11 Aug, 2023, 19:15

Yes and no When running export linux will add the value into the system environment which you can find by running

TypeScript
env

source on the other hand runs the list of bash inside a given file.

전문트롤러
11 Aug, 2023, 19:18

oh...

전문트롤러
11 Aug, 2023, 19:18

after export $(), env shows include .env definitions but source does not

Binyamin
11 Aug, 2023, 19:22

Yes

전문트롤러
12 Aug, 2023, 10:46

[SOLVED] executor does not deploy openruntimes container with proper network

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more