-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Bump images' versions, new GQL deploy script, #1607
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
base: master
Are you sure you want to change the base?
Changes from all commits
2814261
5ff43e9
f1e76ed
6e95ef2
097d8a3
7c816c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| veekun_pokedex_repository = ../pokedex | ||
| local_config = --settings=config.local | ||
| docker_config = --settings=config.docker-compose | ||
| gql_compose_config = -f docker-compose.yml -f docker-compose-dev.yml -f Resources/compose/docker-compose-prod-graphql.yml | ||
| gql_compose_config_deprecated = -f docker-compose.yml -f docker-compose-dev.yml -f Resources/compose/docker-compose-prod-graphql.yml | ||
| gql_compose_config = -f docker-compose.yml -f Resources/compose/docker-compose-prod-graphql.yml | ||
|
|
||
| .PHONY: help | ||
| .SILENT: | ||
|
|
@@ -78,7 +79,7 @@ docker-stop: # (Docker) Stop containers | |
| docker compose stop | ||
|
|
||
| docker-down: # (Docker) Stop and removes containers and networks | ||
| docker compose down | ||
| docker compose down --remove-orphans -v | ||
|
|
||
| docker-test: # (Docker) Run tests | ||
| docker compose exec -T app python manage.py test ${local_config} | ||
|
|
@@ -145,7 +146,7 @@ start-graphql-prod: | |
| git pull origin master | ||
| git submodule update --init | ||
| docker compose -f docker-compose.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d | ||
| docker compose stop app | ||
| docker compose stop app cache | ||
|
|
||
| down-graphql-prod: | ||
| docker container rm $(docker container ls -aq) -f | ||
|
|
@@ -154,18 +155,36 @@ down-graphql-prod: | |
| sync; echo 3 > /proc/sys/vm/drop_caches | ||
|
|
||
| # Nginx doesn't start if upstream graphql-engine is down | ||
| update-graphql-data-prod: | ||
| update-graphql-data-prod-old: | ||
| docker compose ${gql_compose_config} stop | ||
| git pull origin master | ||
| git submodule update --remote --merge | ||
| docker compose ${gql_compose_config} up --pull always -d app cache db | ||
| docker compose ${gql_compose_config_deprecated} up --pull always -d app cache db | ||
| sync; echo 3 > /proc/sys/vm/drop_caches | ||
| make docker-migrate | ||
| make docker-build-db | ||
| docker compose ${gql_compose_config} stop app cache | ||
| docker compose ${gql_compose_config} up --pull always -d graphql-engine graphiql | ||
| docker compose ${gql_compose_config_deprecated} stop app cache | ||
| docker compose ${gql_compose_config_deprecated} up --pull always -d graphql-engine graphiql | ||
| sleep 120 | ||
| make hasura-apply | ||
| docker compose ${gql_compose_config_deprecated} up --pull always -d web | ||
| docker compose exec -T web sh -c 'rm -rf /tmp/cache/*' | ||
| docker image prune -af | ||
| sync; echo 3 > /proc/sys/vm/drop_caches | ||
|
|
||
| update-graphql-data-prod: | ||
| git pull origin master | ||
| git submodule update --remote --merge | ||
| curl -Ss -L -O https://github.com/PokeAPI/pokeapi/releases/download/master-branch/pokeapi.pgdump | ||
| docker compose ${gql_compose_config} stop web graphql-engine app cache | ||
| docker compose ${gql_compose_config} down -v db | ||
| docker compose ${gql_compose_config} up --pull always -d db | ||
| sleep 10 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of arbitrary sleep wouldn't it be better to check container status
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, but I don't want it to be so complicated.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking something like this its still a one liner and kind of a simple do while loop, its more reliable too if for any reason it takes up more than the sleep alotted time similarly for the other sleep too |
||
| docker compose exec -T db pg_restore -U ash -d pokeapi < pokeapi.pgdump | ||
| rm -f pokeapi.pgdump | ||
| docker compose ${gql_compose_config} up --pull always -d graphql-engine | ||
| sleep 30 | ||
| make hasura-apply | ||
| docker compose ${gql_compose_config} up --pull always -d web | ||
| docker compose exec -T web sh -c 'rm -rf /tmp/cache/*' | ||
| docker image prune -af | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| table: | ||
| name: pokemon_v2_pokemonstatpast | ||
| schema: public | ||
| configuration: | ||
| column_config: {} | ||
| custom_column_names: {} | ||
| custom_name: pokemonstatpast | ||
| custom_root_fields: {} | ||
| object_relationships: | ||
| - name: generation | ||
| using: | ||
| foreign_key_constraint_on: generation_id | ||
| - name: pokemon | ||
| using: | ||
| foreign_key_constraint_on: pokemon_id | ||
| - name: stat | ||
| using: | ||
| foreign_key_constraint_on: stat_id | ||
| select_permissions: | ||
| - role: anon | ||
| permission: | ||
| columns: '*' | ||
| filter: {} | ||
| limit: 100000 | ||
| allow_aggregations: true | ||
| query_root_fields: | ||
| - select | ||
| - select_aggregate | ||
| subscription_root_fields: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just an idea but would it be possible to stream or pipe the curl directly to pg restore over reading/writing to disk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course