Skip to content

Commit

Permalink
Add devcontainer-specific configuration
Browse files Browse the repository at this point in the history
Signed-off-by: André Carvalho <[email protected]>
  • Loading branch information
RedRoserade committed Jul 6, 2022
1 parent 60cec31 commit 89a57df
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .devcontainer/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"result_backend": {
"redis": {
"url": "redis://redis:6379/0"
}
},
"state_backend": {
"redis": {
"url": "redis://redis:6379/0"
}
},
"broker": {
"amqp": {
"url": "amqp://rabbitmq:5672"
}
}
}
3 changes: 3 additions & 0 deletions .devcontainer/docker-compose-devcontainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ services:
- vscode_server_data:/home/vscode/.vscode-server
- cache:/home/vscode/.cache

environment:
- MOGNET_CONFIG_FILE=/workspaces/project-mognet/.devcontainer/config.json

command:
- bash
- -c
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ lint: lint-isort lint-black lint-pylint
docker-up:
@docker-compose \
-f $(DOCKER_COMPOSE_FILE) \
up -d \
--remove-orphans
up -d

.PHONY: docker-down
docker-down:
@docker-compose \
-f $(DOCKER_COMPOSE_FILE) \
down

.PHONY: test
test:
Expand Down
8 changes: 4 additions & 4 deletions test/app_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@


def get_config():
config_file_path = Path(os.getenv("MOGNET_TEST_CONFIG_FILE", "config.json"))
config_file_path = Path(os.getenv("MOGNET_CONFIG_FILE", "config.json"))

if config_file_path.is_file():
return AppConfig.parse_file(config_file_path)

return AppConfig(
result_backend=ResultBackendConfig(
redis=RedisResultBackendSettings(url="redis://redis")
redis=RedisResultBackendSettings(url="redis://localhost:6379/0")
),
broker=BrokerConfig(amqp=AmqpBrokerSettings(url="amqp://rabbitmq")),
broker=BrokerConfig(amqp=AmqpBrokerSettings(url="amqp://localhost:5672")),
state_backend=StateBackendConfig(
redis=RedisStateBackendSettings(url="redis://redis")
redis=RedisStateBackendSettings(url="redis://localhost:6379/0")
),
task_routes={},
minimum_concurrency=1,
Expand Down

0 comments on commit 89a57df

Please sign in to comment.