Skip to content

Commit

Permalink
Merge pull request #48 from vimc/mrc-4255
Browse files Browse the repository at this point in the history
mrc-4255 add packit to deployment
  • Loading branch information
hillalex authored Jun 6, 2023
2 parents de287f5 + 47ad664 commit a1d6e73
Show file tree
Hide file tree
Showing 13 changed files with 335 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: "3.10"

- name: Install dependencies
# https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python#installing-dependencies
Expand Down
16 changes: 14 additions & 2 deletions config/complete/orderly-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,27 @@ volumes:

# Optional: to migrate the underlying orderly metadata to outpack metadata
outpack:
repo: mrcide
server:
repo: mrcide
name: outpack_server
tag: main
migrate:
repo: mrcide
name: outpack.orderly
tag: main

# Optional: include Packit app
packit:
repo: mrcide
api:
name: packit-api
tag: main
app:
name: packit
tag: mrc-4261
db:
name: packit-db
tag: main

## Redis configuration
redis:
image:
Expand Down
3 changes: 1 addition & 2 deletions config/montagu/orderly-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ volumes:

# Optional: to migrate the underlying orderly metadata to outpack metadata
outpack:
repo: mrcide
server:
repo: mrcide
name: outpack_server
tag: main
migrate:
repo: mrcide
name: outpack.orderly
tag: main

Expand Down
1 change: 0 additions & 1 deletion config/noproxy/orderly-web.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
## Prefix for container names; we'll use {container_prefix}-(orderly,web)
container_prefix: orderly-web

## The name of the docker network that containers will be attached to.
Expand Down
148 changes: 148 additions & 0 deletions config/packit/orderly-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
## Prefix for container names; we'll use {container_prefix}-(container_name)
container_prefix: orderly-web

## The name of the docker network that containers will be attached to.
## If you want to proxy OrderlyWeb to the host, you will need to
## arrange a proxy on this network, or use dev_mode in the web section
## below.
network: orderly_web_network

## Names of the docker volumes to use:
##
## orderly: stores the orderly archive
## proxy_logs: stores logs from the reverse proxy (only used if proxy is given)
## documents: stores static documentation available through the web app
##
## (More volumes are anticipated as the tool develops)
volumes:
orderly: orderly_web_volume
proxy_logs: orderly_web_proxy_logs
documents: orderly_web_documents
redis: orderly_web_redis_data
outpack: orderly_web_outpack

## Redis configuration
redis:
image:
name: redis
tag: "5.0"
volume: orderly_web_redis_data


## Orderly configuration
orderly:
## Image to use for orderly. This should build off of
## vimc/orderly.server but can be extended to use whatever packages
## you need. The components repo, image and tag will be assembled as
## <repo>/<name>:<tag> for the full docker image reference.
image:
repo: vimc
name: orderly.server
tag: master
worker_name: orderly.server
## Initial data source for the orderly reports. This section is
## optional - if not present, it is up to you to initialise the
## orderly volume (in the volumes section above) with appropriate
## data (if data is not present, orderly will not start). This
## section only has an effect if the volume is empty.
initial:
## Source must be one of "clone" or "demo"
source: clone
## If source is "clone", then "url" must be given. If using a
## private repo, then use an ssh url and provide ssh keys in the
## "ssh" section.
url: https://github.com/reside-ic/orderly-example
## Number of workers to create to run orderly jobs
workers: 1
expose: true
env:
ORDERLY_API_SERVER_IDENTITY: production

## Api and Website configuration
web:
## Image to use for the web components. As for the orderly
## configuration these will be assembled as <repo>/<name>:<tag>. In
## addition, a second image with the database migration support will
## be used as <repo>/<migrate>:<tag>. It is not expected (unlike
## the orderly image) that the 'name' and 'migrate' will need to be
## changed often, and it is expected that a web image will go
## together with corresponding migration and admin images.
image:
repo: vimc
name: orderly-web
tag: master
migrate: orderlyweb-migrate
admin: orderly-web-user-cli
## Public-facing url for the whole web service, including protocol
## (ideally https://), hostname and port (if not using standard
## ports). Here, we're going to use the same as for the proxy but
## if you are using an external proxy then you'd use its hostname
## and port.
url: https://localhost
## If dev_mode is true then the port is exposed to the host (as
## plain http). Do not use in production. The port is attached
## only to the localhost and will not be available from other
## machines
dev_mode: true
## Port to use for the web service
port: 8888
## Name of the web service (affects the UI)
name: OrderlyWeb
## Email address of the web service
email: [email protected]
## Authentication configuration
auth:
## Name of the github organisation if using github auth
github_org: vimc
## Name of the team within this github organisation if using
## github auth (cuurrently must be "" - VIMC
github_team: ""
## If using github auth you will need to register a github oauth app
## https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/
## The "Authorization callback URL" must be set to the public facing url
## that you configured above
github_oauth:
id: "notarealid"
secret: "notarealsecret"
## Enable or disable fine grained permissions
fine_grained: true
## Enable montagu authentication provider
montagu: false

# Optional: to notify a Slack channel during deployment, provide a webhook url
slack:
webhook_url: https://hooks.slack.com/services/T000/B000/XXXX

## If running a proxy directly, fill this section in. Otherwise you
## are responsible for proxying the application out of the docker
## network
proxy:
enabled: true
hostname: localhost
port_http: 80
port_https: 443
image:
repo: vimc
name: orderly-web-proxy
tag: master

outpack:
repo: mrcide
server:
name: outpack_server
tag: main
migrate:
name: outpack.orderly
tag: main

packit:
repo: mrcide
api:
name: packit-api
tag: master
app:
name: packit
tag: mrc-4261
db:
name: packit-db
tag: main
2 changes: 1 addition & 1 deletion config/vault/orderly-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ proxy:
image:
repo: vimc
name: orderly-web-proxy
tag: mrc-211
tag: master
45 changes: 41 additions & 4 deletions orderly_web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def __init__(self, path, dat):
self.volumes["outpack"] = config.config_string(dat, ["volumes",
"outpack"])
self.outpack_repo = config.config_string(
dat, ["outpack", "server", "repo"])
dat, ["outpack", "repo"])
self.outpack_name = config.config_string(
dat, ["outpack", "server", "name"])
self.outpack_tag = config.config_string(
Expand All @@ -191,21 +191,58 @@ def __init__(self, path, dat):
self.outpack_repo, self.outpack_name,
self.outpack_tag)

self.outpack_migrate_repo = config.config_string(
dat, ["outpack", "migrate", "repo"])
self.outpack_migrate_name = config.config_string(
dat, ["outpack", "migrate", "name"])
self.outpack_migrate_tag = config.config_string(
dat, ["outpack", "migrate", "tag"])
self.outpack_migrate_ref = constellation.ImageReference(
self.outpack_migrate_repo, self.outpack_migrate_name,
self.outpack_repo, self.outpack_migrate_name,
self.outpack_migrate_tag)

self.containers["outpack-server"] = "outpack-server"
self.images["outpack-server"] = self.outpack_ref
self.containers["outpack-migrate"] = "outpack-migrate"
self.images["outpack-migrate"] = self.outpack_migrate_ref

# 8. Packit
if "packit" in dat and not self.outpack_enabled:
print("Ignoring Packit configuration as outpack is not enabled")
self.packit_enabled = "packit" in dat and self.outpack_enabled
if self.packit_enabled:
self.packit_repo = config.config_string(
dat, ["packit", "repo"])

self.packit_db_name = config.config_string(
dat, ["packit", "db", "name"])
self.packit_db_tag = config.config_string(
dat, ["packit", "db", "tag"])
self.packit_db_ref = constellation.ImageReference(
self.packit_repo, self.packit_db_name,
self.packit_db_tag)

self.packit_api_name = config.config_string(
dat, ["packit", "api", "name"])
self.packit_api_tag = config.config_string(
dat, ["packit", "api", "tag"])
self.packit_api_ref = constellation.ImageReference(
self.packit_repo, self.packit_api_name,
self.packit_api_tag)

self.packit_app_name = config.config_string(
dat, ["packit", "app", "name"])
self.packit_app_tag = config.config_string(
dat, ["packit", "app", "tag"])
self.packit_app_ref = constellation.ImageReference(
self.packit_repo, self.packit_app_name,
self.packit_app_tag)

self.containers["packit-db"] = "packit-db"
self.images["packit-db"] = self.packit_db_ref
self.containers["packit-api"] = "packit-api"
self.images["packit-api"] = self.packit_api_ref
self.containers["packit"] = "packit"
self.images["packit"] = self.packit_app_ref

self.non_constellation_images = {
"admin": self.admin_ref,
"migrate": self.migrate_ref
Expand Down
Loading

0 comments on commit a1d6e73

Please sign in to comment.