Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
99e2ac6
ci: bump pre-commit/pre-commit-hooks to v5.0.0 for Python 3.13 compat…
davidsmejia May 15, 2026
79058ef
Merge pull request #3578 from AlexsLemonade/davidsmejia/precommit-hoo…
davidsmejia May 18, 2026
15608d1
rbio: add @requires decorator + mtime-gated common sdist rebuild
davidsmejia May 26, 2026
f679022
rbio: add compose:* + new dev:* + test:all (local dev surface)
davidsmejia May 26, 2026
0b0548e
rbio: add deploy:* ops:* install:* (cloud surface)
davidsmejia May 26, 2026
c948622
rbio: add debug:* diagnostics (env, deps, venv)
davidsmejia May 26, 2026
0401025
infra: relocate format_batch_with_env.sh into infrastructure/
davidsmejia May 26, 2026
87d4ad8
api: migrate serve scripts to rbio build + refinebio_default network
davidsmejia May 26, 2026
1e13b3a
infra/deploy.sh: drop scripts/common.sh source, inline its consumers
davidsmejia May 26, 2026
61d89fc
ci: switch deploy to rbio commands, inline branch resolution, rename …
davidsmejia May 26, 2026
7c9ed58
foreman: add calculate_ram_hours management command
davidsmejia May 26, 2026
e829e77
infra/format_batch_with_env.sh: drop dead common.sh source + unused e…
davidsmejia May 26, 2026
280117a
remove scripts/ and obsolete shell wrappers; rbio --help is the entry…
davidsmejia May 26, 2026
253fe71
docs: refresh READMEs to point at rbio commands
davidsmejia May 26, 2026
9be60c3
ci: rename dev:up → compose:up in test job preflight steps
davidsmejia May 26, 2026
230e495
Merge branch 'davidsmejia/3572-02-rbio-local-dev' into davidsmejia/35…
davidsmejia May 26, 2026
4b0167b
Merge branch 'davidsmejia/3572-03-rbio-cloud' into davidsmejia/3572-0…
davidsmejia May 26, 2026
c5b7e97
Merge branch 'davidsmejia/3572-04-rbio-diagnostics' into davidsmejia/…
davidsmejia May 26, 2026
9c8f4e9
Merge branch 'davidsmejia/3572-05-relocate-format-batch' into davidsm…
davidsmejia May 26, 2026
fa24bea
Merge branch 'davidsmejia/3572-06-app-shell-callers' into davidsmejia…
davidsmejia May 26, 2026
b75a719
Merge branch 'davidsmejia/3572-07-infrastructure-callers' into davids…
davidsmejia May 26, 2026
47648d6
Merge branch 'davidsmejia/3572-08-ci-workflow' into davidsmejia/3572-…
davidsmejia May 26, 2026
a0edc34
docker: upgrade base image from Ubuntu 18.04 to 22.04
davidsmejia May 27, 2026
a64568b
docker: widen common sdist COPY glob to accept dash or underscore
davidsmejia May 27, 2026
eac54cc
requirements: drop backports-zoneinfo for Python 3.10
davidsmejia May 27, 2026
5e01c1d
drop RVM curl + gpg + source; replace with single gem install aspera…
davidsmejia May 27, 2026
e17b407
register /usr/local/lib/R/lib with ldconfig
davidsmejia May 27, 2026
47f228c
docker: make R 3.4.4 + rpy2 usable on jammy's runtime
davidsmejia May 27, 2026
ebbe1d1
workers: use PATH-based Rscript, capture R version via cmd_line
davidsmejia May 27, 2026
1f2c1ef
foreman: bump pandas + numpy pins to Python 3.10-compatible versions
davidsmejia May 27, 2026
eac2245
test: chmod only container-owned files in coverage_command
davidsmejia May 27, 2026
a3bcc0b
docker: pre-install testthat with patched Catch.h for glibc 2.34+ compat
davidsmejia May 27, 2026
95c7f3f
docker/deps: fix testthat compile, urllib3/vcrpy, and Py3.10 test imp…
davidsmejia Jun 4, 2026
73d5a5d
replace loop with if
davidsmejia Jun 4, 2026
da918ef
docker: restore unzip on jammy base + set -e in worker download blocks
davidsmejia Jun 4, 2026
90bcf51
docker: drop unsupported --break-system-packages from base pip install
davidsmejia Jun 4, 2026
9c7ada8
docker: constrain cffi<2 so rpy2 3.4.5 builds against its expected ABI
davidsmejia Jun 4, 2026
b29a55b
docker: prebuild rpy2 wheel in base so downstream skips the broken sd…
davidsmejia Jun 4, 2026
00a7ef3
foreman: skip live-API ArrayExpress metadata test
davidsmejia Jun 4, 2026
16f231c
compendia: remove visualization deps and phantomjs code path
davidsmejia Jun 5, 2026
7f3e16c
compendia: move off nvidia/cuda base onto dr_base
davidsmejia Jun 5, 2026
f88b4af
compendia: install fancySVD --no-deps, drop redundant compendia.txt
davidsmejia Jun 5, 2026
4fa6670
Merge pull request #3583 from AlexsLemonade/davidsmejia/3572-01-rbio-…
davidsmejia Jun 9, 2026
7d6572e
Merge pull request #3584 from AlexsLemonade/davidsmejia/3572-02-rbio-…
davidsmejia Jun 9, 2026
d60f2d2
Merge pull request #3585 from AlexsLemonade/davidsmejia/3572-03-rbio-…
davidsmejia Jun 9, 2026
0e3bd98
Merge pull request #3586 from AlexsLemonade/davidsmejia/3572-04-rbio-…
davidsmejia Jun 9, 2026
c0ab332
Merge pull request #3587 from AlexsLemonade/davidsmejia/3572-05-reloc…
davidsmejia Jun 9, 2026
5271312
Merge pull request #3588 from AlexsLemonade/davidsmejia/3572-06-app-s…
davidsmejia Jun 9, 2026
1ba4262
Merge pull request #3589 from AlexsLemonade/davidsmejia/3572-07-infra…
davidsmejia Jun 9, 2026
9b90c8b
Merge pull request #3590 from AlexsLemonade/davidsmejia/3572-08-ci-wo…
davidsmejia Jun 9, 2026
8140d2e
Merge pull request #3591 from AlexsLemonade/davidsmejia/3572-09-cleanup
davidsmejia Jun 9, 2026
2f37714
Merge pull request #3592 from AlexsLemonade/davidsmejia/3573-base-ubu…
davidsmejia Jun 9, 2026
7ec93f6
Merge pull request #3593 from AlexsLemonade/davidsmejia/3574-un-nvidi…
davidsmejia Jun 9, 2026
7dd8862
Merge pull request #3598 from AlexsLemonade/feature/rbio-scripts-migr…
davidsmejia Jun 16, 2026
a4700cf
api: drop dead django-hstore stack
davidsmejia Jun 16, 2026
01e0ab5
api: move base image to Python 3.10
davidsmejia Jun 16, 2026
14e55c4
api/foreman/workers: replace removed conf.urls.url with re_path/path
davidsmejia Jun 16, 2026
1b5df3f
renv: common: point Bioconductor 3.6 archive at the live S3 bucket
davidsmejia Jun 23, 2026
88fb019
setuptools: api: pin setuptools<81 so pkg_resources stays available
davidsmejia Jun 23, 2026
372f44c
apps.py: common: move CommonAppConfig to apps.py, drop default_app_co…
davidsmejia Jun 23, 2026
a67beaa
api/foreman: use stdlib datetime.timezone.utc instead of django.utils…
davidsmejia Jun 24, 2026
2555e45
api: replace drf-yasg + coreapi with drf-spectacular (OpenAPI 3)
davidsmejia Jun 24, 2026
99099a4
api: exclude ExperimentDocumentView.post from schema (drf-spectacular)
davidsmejia Jun 25, 2026
d362b1e
api/common: fix /v1/compendia/ timeout from get_computed_file pk scan
davidsmejia Jun 29, 2026
8fbf512
Merge pull request #3601 from AlexsLemonade/davidsmejia/normalized-co…
davidsmejia Jun 30, 2026
0e16d0a
Merge pull request #3599 from AlexsLemonade/davidsmejia/3596-django-prep
davidsmejia Jul 2, 2026
8fdc143
Merge pull request #3600 from AlexsLemonade/davidsmejia/drf-spectacular
davidsmejia Jul 2, 2026
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
96 changes: 65 additions & 31 deletions .github/scripts/remote_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
# part of our CI/CD process. It therefore assumes that the following
# environment variables will be set:
# - DEPLOY_BOX_IP -- The IP address of the instance to run the deploy on.
# - CI_TAG -- The tag that was pushed to GitHub to trigger the deploy.
# - DEPLOY_TAG -- The tag that was pushed to GitHub to trigger the deploy.
# Will be used as the version for the system and the tag for Docker images.
# - DEPLOY_USER -- The user that triggered the deploy (for resource tagging).
# - BRANCH -- The deploy branch (master|dev), resolved upstream by the
# determine_branch job.
# - DOCKER_USERNAME -- The username that will be used to log into Dockerhub.
# - DOCKER_PASSWORD -- The password that will be used to log into Dockerhub.
# - AWS_ACCESS_KEY_ID -- The AWS key id to use when interacting with AWS.
Expand All @@ -29,10 +32,38 @@ run_on_deploy_box() {
"cd refinebio && $1"
}

# Resolve env-specific values from the branch determined upstream. These are
# written into env_vars (below) so the deploy box's rbio commands can read them.
case "$BRANCH" in
master)
DEPLOY_ENV=prod
DOCKERHUB_REPO=ccdl
BATCH_USE_ON_DEMAND_INSTANCES=false
;;
dev)
DEPLOY_ENV=staging
DOCKERHUB_REPO=ccdlstaging
BATCH_USE_ON_DEMAND_INSTANCES=true
;;
*)
echo "remote_deploy.sh: unexpected BRANCH=$BRANCH (expected master or dev)" >&2
exit 1
;;
esac

# Create file containing local env vars that are needed for deploy.
# SYSTEM_VERSION mirrors DEPLOY_TAG — docker-bake.hcl reads it as the image tag.
# PUSH_CACHE=true tells the bake config to also publish cache layers to the
# registry so subsequent deploy builds are warm.
rm -f env_vars
cat >>env_vars <<EOF
export CI_TAG='$CI_TAG'
export DEPLOY_TAG='$DEPLOY_TAG'
export DEPLOY_USER='$DEPLOY_USER'
export DEPLOY_ENV='$DEPLOY_ENV'
export SYSTEM_VERSION='$DEPLOY_TAG'
export DOCKERHUB_REPO='$DOCKERHUB_REPO'
export PUSH_CACHE=true
export BATCH_USE_ON_DEMAND_INSTANCES='$BATCH_USE_ON_DEMAND_INSTANCES'
export DOCKER_USERNAME='$DOCKER_USERNAME'
export DOCKER_PASSWORD='$DOCKER_PASSWORD'
export AWS_ACCESS_KEY_ID='$AWS_ACCESS_KEY_ID'
Expand All @@ -46,10 +77,10 @@ EOF

# And checkout the correct tag.
run_on_deploy_box "git fetch --all"
run_on_deploy_box "git checkout $CI_TAG"
run_on_deploy_box "git checkout $DEPLOY_TAG"

# Verify that the tag has been signed by a trusted team member.
run_on_deploy_box "bash .github/scripts/verify_tag.sh $CI_TAG"
run_on_deploy_box "bash .github/scripts/verify_tag.sh $DEPLOY_TAG"

# Copy the necessary environment variables over.
scp -o StrictHostKeyChecking=no \
Expand All @@ -61,47 +92,50 @@ scp -o StrictHostKeyChecking=no \
-i infrastructure/data-refinery-key.pem \
-r infrastructure/data-refinery-key.pem ubuntu@"$DEPLOY_BOX_IP":refinebio/infrastructure/data-refinery-key.pem

# Load helper functions and $ALL_IMAGES, compute the deploy repo.
# shellcheck disable=1091
. ./scripts/common.sh
DOCKERHUB_REPO=$(get_deploy_repo "$BRANCH") || exit 1

echo "Building new images"
# Output to the docker update log.
run_on_deploy_box "sudo touch /var/log/docker_update_$CI_TAG.log"
run_on_deploy_box "sudo chown ubuntu:ubuntu /var/log/docker_update_$CI_TAG.log"
run_on_deploy_box ". env_vars && echo -e '######\nBuilding new images for $CI_TAG\n######' 2>&1 | tee -a /var/log/docker_update_$CI_TAG.log"
run_on_deploy_box "sudo touch /var/log/docker_update_$DEPLOY_TAG.log"
run_on_deploy_box "sudo chown ubuntu:ubuntu /var/log/docker_update_$DEPLOY_TAG.log"
run_on_deploy_box ". env_vars && echo -e '######\nBuilding new images for $DEPLOY_TAG\n######' 2>&1 | tee -a /var/log/docker_update_$DEPLOY_TAG.log"
# DOCKER_IO_USERNAME / DOCKER_IO_PASSWORD are expected to be set in the deploy box's environment. They are probably legacy.
run_on_deploy_box "docker login -u \"\$DOCKER_IO_USERNAME\" -p \"\$DOCKER_IO_PASSWORD\""
run_on_deploy_box ". env_vars && ./scripts/update_docker_images.sh -u -g deploy -r $DOCKERHUB_REPO -v $CI_TAG 2>&1 | tee -a /var/log/docker_update_$CI_TAG.log"
run_on_deploy_box ". env_vars && echo -e '######\nFinished building new images for $CI_TAG\n######' 2>&1 | tee -a /var/log/docker_update_$CI_TAG.log"

# It's somehow possible for Docker to sometimes not successfully push
# an image but yet still exit successfully. See:
# https://github.com/AlexsLemonade/refinebio/issues/784
# Since it's not clear how that happened, the safest thing is to add
# an explicit check that the Docker images were successfully updated.
run_on_deploy_box ". env_vars && ./bin/rbio build --push deploy 2>&1 | tee -a /var/log/docker_update_$DEPLOY_TAG.log"
run_on_deploy_box ". env_vars && echo -e '######\nFinished building new images for $DEPLOY_TAG\n######' 2>&1 | tee -a /var/log/docker_update_$DEPLOY_TAG.log"

# Docker sometimes exits 0 from `bake --push` even when the push failed (see
# https://github.com/AlexsLemonade/refinebio/issues/784). Verify each image
# is actually on Dockerhub before proceeding to deploy.
docker_image_exists() {
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST \
-d '{"username": "'"${DOCKER_USERNAME}"'", "password": "'"${DOCKER_PASSWORD}"'"}' \
https://hub.docker.com/v2/users/login/ | jq -r .token)
EXISTS=$(curl -s -H "Authorization: JWT ${TOKEN}" \
"https://hub.docker.com/v2/repositories/$1/tags/?page_size=10000" |
jq -r "[.results | .[] | .name == \"$2\"] | any" 2>/dev/null)
test -n "$EXISTS" -a "$EXISTS" = true
}

ALL_IMAGES="base api_base api foreman smasher compendia illumina affymetrix salmon transcriptome no_op downloaders"

for image in $ALL_IMAGES; do
image_name="$DOCKERHUB_REPO/dr_$image"
if ! docker_image_exists "$image_name" "$CI_TAG"; then
echo "Docker image $image_name:$CI_TAG doesn't exist after running update_docker_images.sh!"
if ! docker_image_exists "$image_name" "$DEPLOY_TAG"; then
echo "Docker image $image_name:$DEPLOY_TAG doesn't exist after building!"
echo "This is generally caused by a temporary error, please try the 'Rerun workflow' button."
exit 1
fi
done

# Notify CircleCI that the images have been built.
echo "Finished building new images, running run_terraform.sh."
echo "Finished building new images, running rbio deploy:up."

run_on_deploy_box "sudo touch /var/log/deploy_$CI_TAG.log"
run_on_deploy_box "sudo chown ubuntu:ubuntu /var/log/deploy_$CI_TAG.log"
run_on_deploy_box ". env_vars && echo -e '######\nStarting new deploy for $CI_TAG\n######' >> /var/log/deploy_$CI_TAG.log 2>&1"
run_on_deploy_box "sudo .github/scripts/update_ca_certificates.sh >> /var/log/deploy_$CI_TAG.log 2>&1"
run_on_deploy_box "sudo touch /var/log/deploy_$DEPLOY_TAG.log"
run_on_deploy_box "sudo chown ubuntu:ubuntu /var/log/deploy_$DEPLOY_TAG.log"
run_on_deploy_box ". env_vars && echo -e '######\nStarting new deploy for $DEPLOY_TAG\n######' >> /var/log/deploy_$DEPLOY_TAG.log 2>&1"
run_on_deploy_box "sudo .github/scripts/update_ca_certificates.sh >> /var/log/deploy_$DEPLOY_TAG.log 2>&1"

# This should never be logged to Github Actions in case it exposes any secrets as terraform output.
run_on_deploy_box ". env_vars && .github/scripts/run_terraform.sh >> /var/log/deploy_$CI_TAG.log 2>&1"
run_on_deploy_box ". env_vars && ./bin/rbio deploy:up >> /var/log/deploy_$DEPLOY_TAG.log 2>&1"

run_on_deploy_box ". env_vars && echo -e '######\nDeploying $CI_TAG finished!\n######' >> /var/log/deploy_$CI_TAG.log 2>&1"
run_on_deploy_box ". env_vars && echo -e '######\nDeploying $DEPLOY_TAG finished!\n######' >> /var/log/deploy_$DEPLOY_TAG.log 2>&1"

.github/scripts/slackpost_deploy.sh robots deploybot

Expand Down
52 changes: 0 additions & 52 deletions .github/scripts/run_terraform.sh

This file was deleted.

11 changes: 1 addition & 10 deletions .github/scripts/slackpost_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,7 @@ if [[ $username == "" ]]; then
fi

# ------------
master_check=$(git branch --contains "tags/$CI_TAG" | grep '^ master$' || true)
dev_check=$(git branch --contains "tags/$CI_TAG" | grep '^ dev$' || true)

if [[ -n $master_check ]]; then
CI_BRANCH=master
elif [[ -n $dev_check ]]; then
CI_BRANCH=dev
fi

text="New deployment! Woo! $CI_USERNAME: $CI_BRANCH $CI_TAG"
text="New deployment! Woo! $DEPLOY_USER: $BRANCH $DEPLOY_TAG"

escapedText=$(echo "$text" | sed 's/"/\"/g' | sed "s/'/\'/g")

Expand Down
Loading
Loading