Skip to content

Commit

Permalink
add config
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Aug 16, 2024
1 parent 46992bb commit 9638768
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
push:
branches:
- main
pull_request:
branches:
- '*'

name: Tests

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12.3

- name: Install dependencies
# https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python#installing-dependencies
# If installing a development version of constellation, use:
# - pip3 install git+https://github.com/reside-ic/constellation@reside-62#egg=constellation
run: |
python -m pip install --upgrade setuptools pip wheel
pip3 install pytest-cov pycodestyle codecov
pip3 install -r requirements.txt
- name: Tests
run: |
pytest --cov=src
- name: Lint
run: |
pycodestyle .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

# TODO: build and push proxy (same model as packit)
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.idea

# Default Python .gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
# daedalus-deploy
Deploy tool for the Daedalus app

## Installation
Clone this repo and install dependencies with:
```
pip3 install --user -r requirements.txt
```

## Usage

```
Usage:
./daedalus start [--pull] [<configname>]
./daedalus stop [--volumes] [--network] [--kill] [--force]
./daedalus destroy
./daedalus status
./daedalus upgrade
Options:
--pull Pull images before starting
--volumes Remove volumes (WARNING: irreversible data loss)
--network Remove network
--kill Kill the containers (faster, but possible db corruption)
```

Once a configuration is set during `start`, it will be reused by subsequent commands
(`stop`, `status`, `upgrade`, `user`, etc) and removed during destroy.
The configuration usage information is stored in `config/.last_deploy.`

## Deployment configurations
There are three configurations
- noproxy: for local testing
- staging: for deployment onto our staging server at `daedalus.dev.dide.ic.ac.uk`
- prod: tbd!
22 changes: 22 additions & 0 deletions config/daedalus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
docker:
network: daedalus
api:
image:
repo: mrcide
name: daedalus-api
tag: latest
port: 8001
db:
image:
repo: ghcr.io/jameel-institute
name: daedalus-web-app-db
# TODO: update to main when merged
tag: jidea-59-dockerise-web-app
port: 5432
web_app:
image:
repo: ghcr/jameel-institute
name: daedalus-web-app
# TODO: update to main when merged
tag: jidea-59-dockerise-web-app
port: 3000
1 change: 1 addition & 0 deletions config/noproxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Default config only for now
10 changes: 10 additions & 0 deletions config/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
proxy:
image:
repo: ghcr.io/jameel-institute
name: daedalus-proxy
# TODO: update to main when merged
tag: jidea-50
host: beebop-dev.dide.ic.ac.uk
ssl:
certificate: VAULT:secret/daedalus/ssl/staging:cert
key: VAULT:secret/beebop/daedalus/ssl/staging:key
5 changes: 5 additions & 0 deletions daedalus
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env python3
from src.daedalus_cli import main

if __name__ == "__main__":
main()
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
constellation==1.0.0
docopt
pytest
timeago
requests

0 comments on commit 9638768

Please sign in to comment.