Skip to content
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

Mount public wpsoutputs data #360

Merged
merged 19 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e57d421
mount public wpsoutputs data with cowbird and jupyterlab instances
cwcummings Jul 18, 2023
c040992
bump cowbird to 2.0.0 and mongo to 5.0 to support the new cowbird ver…
cwcummings Jul 25, 2023
438b3de
isolate mongodb 5.0 required for cowbird
cwcummings Jul 25, 2023
d5f9ded
update changelog
cwcummings Jul 25, 2023
fce59da
review changelog
cwcummings Jul 25, 2023
5ed155c
remove unused wpsoutputs mount
cwcummings Aug 8, 2023
53c5cb8
Merge branch 'master' of github.com:bird-house/birdhouse-deploy into …
cwcummings Aug 9, 2023
d800550
updates after pr feedback
cwcummings Aug 21, 2023
3bc3133
add secure-data-proxy name variable to cowbird
cwcummings Sep 7, 2023
2520f80
add new optional cowbird config parameters as comments
cwcummings Sep 18, 2023
71fc669
Merge branch 'master' of github.com:bird-house/birdhouse-deploy into …
cwcummings Sep 18, 2023
5673593
review wps outputs variables
cwcummings Sep 18, 2023
7afd194
bump cowbird version and move changes in changelog
cwcummings Sep 18, 2023
c8c8728
small adjust cowbird vars
cwcummings Sep 18, 2023
1c66ed4
use 'build.os' instead of deprecated 'build.image' in readthedocs config
cwcummings Sep 18, 2023
cadd9f4
try newer python version for readthedocs
cwcummings Sep 22, 2023
90611a7
Merge branch 'master' of github.com:bird-house/birdhouse-deploy into …
cwcummings Sep 22, 2023
7119db0
Merge branch 'master' of github.com:bird-house/birdhouse-deploy into …
cwcummings Sep 25, 2023
5ffcb0f
Bump version: 1.32.0 → 1.33.0
cwcummings Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ sphinx:
# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
# Optionally set the Python requirements required to build your docs
python:
version: 3.6
install:
- requirements: docs/requirements.txt

#conda:
# environment: environment-docs.yml

build:
image: stable
os: "ubuntu-22.04"
tools:
python: "3.6"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless something breaks during build, 3.8 at least, since this is already EOL for a while.
(could also be a separate PR)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version updated to 3.10, readthedocs seems to build successfully.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very weird that even latest commit built RTD without problem with the options that you found were causing errors:
ce5c14d

But your latest one is also good:
90611a7 (#360)

Funky stuff happening recently on RTD it seems...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason the latest build on master could be successful was because RTD is deprecating the option progressively, doing temporary deprecation enforcements until in a few weeks where the option becomes fully deprecated (see blog here). I just happened to build it on Sept. 18th where I got the deprecation error.

22 changes: 16 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,22 @@
[Unreleased](https://github.com/bird-house/birdhouse-deploy/tree/master) (latest)
------------------------------------------------------------------------------------------------------------------

[//]: # (list changes here, using '-' for each new entry, remove this when items are added)
## Changes

- Add public WPS outputs directory to Cowbird and add corresponding volume mount to JupyterHub.
- Update `cowbird` service from [1.2.0](https://github.com/Ouranosinc/cowbird/tree/1.2.0)
to [2.1.0](https://github.com/Ouranosinc/cowbird/tree/2.1.0).
- Require `MongoDB==5.0` Docker image for Cowbird's database.
- Add `WPS_OUTPUTS_DIR` env variable to manage the location of the WPS outputs data.

## Important
Because of the new `MongoDB==5.0` database requirement for Cowbird that uses (potentially) distinct version from other
birds, a separate Docker image is employed only for Cowbird. If some processes, jobs, or other Cowbird-related data
was already defined on one of your server instances, manual transfer between the generic
`${DATA_PERSIST_ROOT}/mongodb_persist` to new `${DATA_PERSIST_ROOT}/mongodb_cowbird_persist` directory must be
accomplished. The data in the new directory should then be migrated to the new version following the same procedure as
described for Weaver in
[Database Migration](https://pavics-weaver.readthedocs.io/en/latest/installation.html?#database-migration).

[1.31.2](https://github.com/bird-house/birdhouse-deploy/tree/1.31.2) (2023-09-13)
------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -147,11 +162,6 @@
[CMIP Dataset Ingestion Workflows](https://github.com/cedadev/stac-generator-example/tree/master/conf).

- Adds ``optional-components/stac-public-access`` to give public access to the STAC catalog.
ChaamC marked this conversation as resolved.
Show resolved Hide resolved
- Add public wps outputs directory to Cowbird and add corresponding volume mount to JupyterHub.
- Update `cowbird` service from [1.2.0](https://github.com/Ouranosinc/cowbird/tree/1.2.0)
to [2.0.0](https://github.com/Ouranosinc/cowbird/tree/2.0.0)
- Require `MongoDB==5.0` Docker image for Cowbird's database.
- Add `WPS_OUTPUTS_DIR` env variable to manage the location of the wps outputs data.

[1.27.1](https://github.com/bird-house/birdhouse-deploy/tree/1.27.1) (2023-07-10)
------------------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ handlers:
workspace_dir: ${WORKSPACE_DIR}
jupyterhub_user_data_dir: ${JUPYTERHUB_USER_DATA_DIR}
wps_outputs_dir: ${WPS_OUTPUTS_DIR}
wps_outputs_public_subdir: ${WPS_OUTPUTS_PUBLIC_SUBDIR}
secure_data_proxy_name: ${SECURE_DATA_PROXY_NAME}
# wps_outputs_res_name: ${WPS_OUTPUTS_RES_NAME}
public_workspace_wps_outputs_subdir: ${PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBDIR}
# notebooks_dir_name: ${NOTEBOOKS_DIR_NAME}
# user_wps_outputs_dir_name: ${USER_WPS_OUTPUTS_DIR_NAME}

# [Required] This section defines how to synchronize permissions between services when they share resources
sync_permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ services:
jupyterhub:
environment:
WORKSPACE_DIR: ${DATA_PERSIST_ROOT}/${USER_WORKSPACES}
WPS_OUTPUTS_PUBLIC_SUBDIR: ${WPS_OUTPUTS_PUBLIC_SUBDIR}
PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBDIR: ${PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBDIR}
volumes:
- "${DATA_PERSIST_ROOT}/${USER_WORKSPACES}:${DATA_PERSIST_ROOT}/${USER_WORKSPACES}"
18 changes: 10 additions & 8 deletions birdhouse/components/cowbird/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
EXTRA_VARS='
${COWBIRD_VERSION}
${COWBIRD_MONGODB_VERSION}
${COWBIRD_MONGODB_SERVICE}
${COWBIRD_MONGODB_HOST}
${COWBIRD_MONGODB_PORT}
${USER_WORKSPACES}
${WPS_OUTPUTS_PUBLIC_SUBDIR}
${PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBDIR}
${SECURE_DATA_PROXY_NAME}
'
# extend the original 'VARS' from 'birdhouse/pavics-compose.sh' to employ them for template substitution
# adding them to 'VARS', they will also be validated in case of override of 'default.env' using 'env.local'
Expand All @@ -27,7 +27,7 @@ VARS="$VARS $EXTRA_VARS"
# Cowbird Configuration
# =====================

export COWBIRD_VERSION="2.0.0"
export COWBIRD_VERSION="2.1.0"

# default release of the MongoDB version employed by Cowbird
# note that MongoDB>=5.0 is REQUIRED for Cowbird>=2.0.0
Expand All @@ -36,19 +36,21 @@ export COWBIRD_MONGODB_VERSION=5.0
# or use another service (e.g.: dedicated mongodb)
# the 'host' is the mongo 'service' inter-docker network connection in this case
# the selected 'mongo' service should be member of a network of same name
export COWBIRD_MONGODB_SERVICE=cowbird-mongodb
export COWBIRD_MONGODB_HOST=${COWBIRD_MONGODB_SERVICE}
export COWBIRD_MONGODB_HOST=cowbird-mongodb
export COWBIRD_MONGODB_PORT=27017

# Subdirectory containing the user workspaces used by Cowbird
export USER_WORKSPACES="user_workspaces"

# Subdirectory containing the hardlinks to the public wpsoutputs data
# Subdirectory containing the hardlinks to the public WPS outputs data
# This directory will be mounted on the JupyterLab instances and is located by default
# in the ${USER_WORKSPACES} directory.
export WPS_OUTPUTS_PUBLIC_SUBDIR="public/wpsoutputs"
export PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBDIR="public/wps_outputs"

# this dependency is only required if COWBIRD_MONGODB_SERVICE is the one provided in config/mongodb.
# Default name for the secure-data-proxy service from Magpie.
export SECURE_DATA_PROXY_NAME="secure-data-proxy"

# this dependency is only required if the mongo instance is the one provided in config/mongodb.
# (include this for Cowbird<2.0.0)
#COMPONENT_DEPENDENCIES="
# $COMPONENT_DEPENDENCIES
Expand Down
19 changes: 10 additions & 9 deletions birdhouse/components/cowbird/docker-compose-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ services:
# root user
COWBIRD_FILESYSTEM_ADMIN_UID: 0
COWBIRD_FILESYSTEM_ADMIN_GID: 0
PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBDIR: ${PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBDIR}
SECURE_DATA_PROXY_NAME: ${SECURE_DATA_PROXY_NAME}
# Note that WPS_OUTPUTS_DIR and WORKSPACE_DIR must both point to paths from the same volume.
# This is to allow the creation of hardlinks between the wpsoutputs and the user workspace.
WPS_OUTPUTS_DIR: ${WPS_OUTPUTS_DIR}
WPS_OUTPUTS_PUBLIC_SUBDIR: ${WPS_OUTPUTS_PUBLIC_SUBDIR}
WORKSPACE_DIR: ${DATA_PERSIST_ROOT}/${USER_WORKSPACES}
links:
- "${COWBIRD_MONGODB_SERVICE}"
- cowbird-mongodb
networks:
- default
- "${COWBIRD_MONGODB_SERVICE}"
- cowbird-mongodb
depends_on:
- "${COWBIRD_MONGODB_SERVICE}"
- cowbird-mongodb
volumes:
- ./components/cowbird/config/cowbird/config.yml:/opt/local/src/cowbird/config/cowbird.yml
- ./components/cowbird/config/cowbird/cowbird.ini:/opt/local/src/cowbird/config/cowbird.ini
Expand All @@ -58,12 +59,12 @@ services:
COWBIRD_FILESYSTEM_ADMIN_GID: 0
WORKSPACE_DIR: ${DATA_PERSIST_ROOT}/${USER_WORKSPACES}
links:
- "${COWBIRD_MONGODB_SERVICE}"
- cowbird-mongodb
networks:
- default
- "${COWBIRD_MONGODB_SERVICE}"
- cowbird-mongodb
depends_on:
- "${COWBIRD_MONGODB_SERVICE}"
- cowbird-mongodb
- cowbird # if not started first, sometimes celery misbehaves and will not pick jobs in queue
volumes:
- ./components/cowbird/config/cowbird/config.yml:/opt/local/src/cowbird/config/cowbird.yml
Expand All @@ -76,9 +77,9 @@ services:
# Dedicated database for Cowbird, since other 'mongodb' image does not employ the same version.
cowbird-mongodb:
image: mongo:${COWBIRD_MONGODB_VERSION}
container_name: ${COWBIRD_MONGODB_SERVICE}
container_name: cowbird-mongodb
networks:
- "${COWBIRD_MONGODB_SERVICE}"
- cowbird-mongodb
volumes:
- ${DATA_PERSIST_ROOT}/mongodb_cowbird_persist:/data/db
restart: always
Expand Down
4 changes: 2 additions & 2 deletions birdhouse/components/weaver/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export WEAVER_WPS_PATH=/wps
export WEAVER_WPS_OUTPUTS_PATH="/wpsoutputs/weaver"
# data persistence of wps outputs (directory path)
# NOTE:
# follow the same convension of 'wps_outputs/<bird>' as the rest of the stact
export WEAVER_WPS_OUTPUTS_DIR='${DATA_PERSIST_ROOT}/wps_outputs/weaver'
# follow the same convention of 'wps_outputs/<bird>' as the rest of the stack
export WEAVER_WPS_OUTPUTS_DIR='${WPS_OUTPUTS_DIR}/weaver'
export WEAVER_WPS_WORKDIR="/tmp/wps_workdir/weaver"

# logging
Expand Down
4 changes: 2 additions & 2 deletions birdhouse/config/jupyterhub/jupyterhub_config.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ if os.environ['WORKSPACE_DIR'] != jupyterhub_data_dir:
"bind": join(jupyterhub_data_dir, "{username}"),
"mode": "rw"
}
c.DockerSpawner.volumes[join(os.environ['WORKSPACE_DIR'], os.environ['WPS_OUTPUTS_PUBLIC_SUBDIR'])] = {
"bind": join(notebook_dir, os.environ['WPS_OUTPUTS_PUBLIC_SUBDIR']),
c.DockerSpawner.volumes[join(os.environ['WORKSPACE_DIR'], os.environ['PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBDIR'])] = {
"bind": join(notebook_dir, os.environ['PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBDIR']),
"mode": "ro"
}

Expand Down
2 changes: 1 addition & 1 deletion birdhouse/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ export DEFAULT_CONF_DIRS='
export USER_WORKSPACE_UID=1000
export USER_WORKSPACE_GID=1000

export WPS_OUTPUTS_DIR="/data/wpsoutputs"
export WPS_OUTPUTS_DIR="${DATA_PERSIST_ROOT}/wps_outputs"
fmigneault marked this conversation as resolved.
Show resolved Hide resolved