Skip to content

Commit

Permalink
replace yaml-merge with yq, fix quickstart deployment docs. Closes #1780
Browse files Browse the repository at this point in the history
  • Loading branch information
umesh-timalsina committed Jul 17, 2020
1 parent 34bfe15 commit cb5505a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .deployment/deploy-deepforge
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ fi;
rm config/components2.json

# Merging the custom override yml file
yaml-merge docker/docker-compose.yml "$DEEPFORGE_DEPLOYMENT_DIR"/docker-compose-overrides.yml > custom-docker-compose.yml
yq d docker/docker-compose.yml services.server.environment[0] > custom-docker-compose.yml
yq m -ai custom-docker-compose.yml "$DEEPFORGE_DEPLOYMENT_DIR"/docker-compose-overrides.yml

# Pulling the latest docker image, stopping the server, removing and restarting it
docker-compose --file custom-docker-compose.yml -p deepforge pull $SERVER_NAME
Expand Down
2 changes: 1 addition & 1 deletion .deployment/docker-compose-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ services:
server:
entrypoint: /.deployment/dev-entrypoint.sh
environment:
- "NODE_ENV=production"
- "DEEPFORGE_HOST=https://dev.deepforge.org"
- "DEEPFORGE_INTERACTIVE_COMPUTE_HOST=https://dev-compute.deepforge.org"
volumes:
- "$HOME/.deepforge/blob:/data/blob"
- "${TOKEN_KEYS_DIR}:/token_keys"
- "${DEEPFORGE_DEPLOYMENT_DIR}:/.deployment"
- "${DEEPFORGE_DEPLOYMENT_DIR}/../config/components.json:/deepforge/config/components.json"
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
- "$HOME/.deepforge/data:/data/db"
server:
environment:
- "NODE_ENV=default"
- "MONGO_URI=mongodb://mongo:27017/deepforge"
- "DEEPFORGE_PUBLIC_KEY=/token_keys/public_key"
- "DEEPFORGE_PRIVATE_KEY=/token_keys/private_key"
Expand All @@ -16,6 +17,5 @@ services:
- "8889:8889"
volumes:
- "$HOME/.deepforge/blob:/data/blob"
- "${TOKEN_KEYS_DIR}:/token_keys"
depends_on:
- mongo
41 changes: 27 additions & 14 deletions docs/deployment/quick_start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,7 @@ Next, you must decide if you would like authentication to be enabled. For produc

Without User Accounts
---------------------
Open the docker-compose file and add the following environment variable to the server:

.. code-block:: bash
NODE_ENV=default
and delete the volume for the server's keys (used for signing JWTs):

.. code-block:: bash
- "${TOKEN_KEYS_DIR}:/token_keys"
Next, start the docker containers with
Start the docker containers with

.. code-block:: bash
Expand All @@ -41,11 +29,36 @@ First, generate a public and private key pair
openssl rsa -in deepforge_keys/private_key -pubout > deepforge_keys/public_key
export TOKEN_KEYS_DIR="$(pwd)/deepforge_keys"
Then create file called ``production-docker-compose.yml`` for using the token-keys generated above:

.. code-block:: yaml
version: "3"
services:
mongo:
image: mongo
volumes:
- "$HOME/.deepforge/data:/data/db"
server:
environment:
- "MONGO_URI=mongodb://mongo:27017/deepforge"
- "DEEPFORGE_PUBLIC_KEY=/token_keys/public_key"
- "DEEPFORGE_PRIVATE_KEY=/token_keys/private_key"
image: deepforge/kitchen-sink:latest
ports:
- "8888:8888"
- "8889:8889"
volumes:
- "$HOME/.deepforge/blob:/data/blob"
- "${TOKEN_KEYS_DIR}:/token_keys"
depends_on:
- mongo
Then start DeepForge using docker-compose:

.. code-block:: bash
docker-compose up
docker-compose --file production-docker-compose.yml up
Finally, create the admin user by connecting to the server's docker container. First, get the ID of the container using:

Expand Down

0 comments on commit cb5505a

Please sign in to comment.