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

Dev to Staging: Agora 3.5.0 and Data mv71 #1343

Merged
merged 55 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
37bd45d
AG-1471: install synapseclient, download release data from Synpase
hallieswan Jun 5, 2024
841db25
AG-1473: create mongo image containing release data
hallieswan Jun 5, 2024
e957154
AG-1474: run e2e tests
hallieswan Jun 5, 2024
7e28125
AG-1471: do not run job on pull_request trigger since forks do not ha…
hallieswan Jun 6, 2024
41a3a2f
Merge pull request #1311 from hallieswan/AG-1471_AG-1473_AG-1474
sagely1 Jun 6, 2024
66cece3
AG-1472: check if image exists in GHCR, then build/push image if needed
hallieswan Jun 13, 2024
3b527b7
AG-1472: split workflow into three jobs
hallieswan Jun 13, 2024
71d8316
AG-1472: handle case where package has not yet been created
hallieswan Jun 13, 2024
072d0fc
AG-1472: remove forward slash from package name so gh call works
hallieswan Jun 13, 2024
48b4d5a
AG-1472: ensure e2e tests are run when image has already been built
hallieswan Jun 13, 2024
ca3242f
AG-1472: improvements from code review
hallieswan Jun 14, 2024
ea0d1f4
Merge pull request #1313 from hallieswan/AG-1472
hallieswan Jun 14, 2024
ec54f2d
Bump braces from 3.0.2 to 3.0.3
dependabot[bot] Jun 14, 2024
faac594
AG-1472: ensure org package is lowercase
hallieswan Jun 14, 2024
2d3c570
Merge pull request #1315 from hallieswan/AG-1472
hallieswan Jun 14, 2024
1945032
AG-1498: support use of containerized data image in local development…
hallieswan Jun 14, 2024
7059525
AG-1330: combine workflows into one workflow with multiple jobs
hallieswan Jun 17, 2024
fe40afc
Merge pull request #1314 from Sage-Bionetworks/dependabot/npm_and_yar…
sagely1 Jun 18, 2024
e90d0eb
Merge pull request #1316 from hallieswan/AG-1498
hallieswan Jun 18, 2024
e882d81
Merge pull request #1317 from hallieswan/AG-1330
hallieswan Jun 18, 2024
24cc20d
AG-1518: rename data release image to distinguish from sage-monorepo …
hallieswan Jun 27, 2024
fab3e08
Merge pull request #1319 from hallieswan/AG-1518
hallieswan Jun 27, 2024
b4392b5
Bump fast-xml-parser and @aws-sdk/credential-providers
dependabot[bot] Aug 7, 2024
a957573
Merge pull request #1321 from Sage-Bionetworks/dependabot/npm_and_yar…
sagely1 Aug 14, 2024
fd775f9
Bump to mv70 (display) in dev
JessterB Nov 2, 2024
457ef7b
Merge pull request #1331 from JessterB/AG-1395
JessterB Nov 6, 2024
51b2d4d
AG-1395: Fix typo in manifest version value
JessterB Nov 6, 2024
651b087
Merge pull request #1332 from JessterB/AG-1395
JessterB Nov 6, 2024
38963af
removed druggability section in gene details resources tab
sagely1 Nov 25, 2024
8ff7978
added new resource cards in Resources tab
sagely1 Nov 27, 2024
95312a5
adding pharos class to hero
sagely1 Nov 27, 2024
6f5e712
updated section title from PHAROS to PHAROS CLASS
sagely1 Nov 27, 2024
b6e7ed1
Adjust ordering of resource sections
JessterB Nov 27, 2024
0262988
Update resource strings and URLs
JessterB Nov 27, 2024
91a8bb7
Update mongoDB install URLs in README
JessterB Nov 27, 2024
1546aef
Merge pull request #1334 from sagely1/AG-1488-add-new-resource-section
JessterB Nov 27, 2024
d78f439
adding uniprotkb_accessions links
sagely1 Nov 27, 2024
2d0e93a
merging develop
sagely1 Nov 27, 2024
154300f
Merge pull request #1333 from sagely1/AG-1486-remove-druggability
sagely1 Nov 27, 2024
dab1ac8
applied a margin under subheadings biodomains and pharos class
sagely1 Nov 27, 2024
b0e0624
adding margin to subitems in hero
sagely1 Nov 28, 2024
377b5c4
Merge pull request #1335 from sagely1/AG-1257-add-pharos-class-to-gen…
sagely1 Nov 28, 2024
9ef59c6
Merge pull request #1336 from JessterB/AG-1488-add-new-resource-section
sagely1 Nov 28, 2024
0737f41
Merge branch 'develop' into AG-1539-surface-uniprot-links-in-gene-hero
sagely1 Nov 28, 2024
a2ff72b
added new uniprotkb_accessions property to mocks
sagely1 Nov 28, 2024
4b67ad9
Merge pull request #1337 from sagely1/AG-1539-surface-uniprot-links-i…
sagely1 Nov 28, 2024
2da975a
Update ci.yml
sagely1 Dec 3, 2024
41996e5
Merge pull request #2 from sagely1/sagely1-docker-compose-fix
sagely1 Dec 3, 2024
57fa18a
AG-1565 remove druggability columns
sagely1 Dec 16, 2024
40b2ca1
Merge pull request #1338 from sagely1/develop
JessterB Dec 16, 2024
4524665
Merge pull request #1340 from sagely1/AG-1565-remove-druggability
JessterB Dec 16, 2024
3adca17
AG-1599 remove pharos class
sagely1 Dec 17, 2024
f0e2705
Merge pull request #1341 from sagely1/AG-1599-pharos-class
JessterB Dec 17, 2024
4a9d8d4
fix pharos class schema bug
sagely1 Dec 18, 2024
65b774b
Merge pull request #1342 from sagely1/AG-1600-pharos-class-bug
JessterB Dec 18, 2024
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
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DB_USER="root"
DB_PASS="${DB_PASS}"
DB_PORT="27015"
DB_NAME="agora"
DATA_IMAGE_PATH="ghcr.io/sage-bionetworks/agora-data-nonmonorepo:${DATA_IMAGE_TAG}"
247 changes: 247 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
name: Build and run unit tests, build data image and run e2e tests

on: push

jobs:
build-and-run-unit-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'
- run: npm ci
- run: APP_ENV=develop npm run ci:build:develop
- run: npm test

check-for-image:
# Run in Sage repo on develop or main branches
# and on all branches in user-owned forks
if: ${{ github.ref_name == 'develop' || github.ref_name == 'main' || github.actor == github.repository_owner }}
timeout-minutes: 5
runs-on: ubuntu-20.04
permissions:
packages: read
environment: e2e
env:
ORG_NAME: 'Sage-Bionetworks'
NAMESPACE: ${{ github.repository_owner }}
DATA_IMAGE_NAME: '${{ vars.DB_NAME }}-data-nonmonorepo'
outputs:
DATA_MANIFEST_ID: ${{ steps.get-ids-from-package-json.outputs.DATA_MANIFEST_ID }}
DATA_VERSION: ${{ steps.get-ids-from-package-json.outputs.DATA_VERSION }}
DATA_IMAGE_PATH: ${{ steps.get-ids-from-package-json.outputs.DATA_IMAGE_PATH }}
IMAGE_EXISTS: ${{ steps.check-container-repo.outputs.IMAGE_EXISTS }}
steps:
- uses: actions/checkout@v4

- name: get data image tag, data manifest id, and data version
id: get-ids-from-package-json
env:
PACKAGE_JSON_PATH: 'package.json'
run: |
DATA_MANIFEST_ID=$(jq -r '."data-file"' "${{ env.PACKAGE_JSON_PATH }}")
echo "DATA_MANIFEST_ID=${DATA_MANIFEST_ID}" >> "$GITHUB_OUTPUT"

DATA_VERSION=$(jq -r '."data-version"' "${{ env.PACKAGE_JSON_PATH }}")
echo "DATA_VERSION=${DATA_VERSION}" >> "$GITHUB_OUTPUT"

DATA_IMAGE_TAG="${DATA_MANIFEST_ID}.${DATA_VERSION}"
echo "DATA_IMAGE_TAG=${DATA_IMAGE_TAG}" >> "$GITHUB_OUTPUT"

# GHCR requires image names to be lowercase: https://github.com/orgs/community/discussions/27086
NAMESPACE_LOWERCASE=$(echo "${{ env.NAMESPACE }}" | tr '[:upper:]' '[:lower:]')
DATA_IMAGE_PATH="ghcr.io/${NAMESPACE_LOWERCASE}/${{ env.DATA_IMAGE_NAME }}:${DATA_IMAGE_TAG}"
echo "DATA_IMAGE_PATH=${DATA_IMAGE_PATH}" >> "$GITHUB_OUTPUT"

- name: login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: check whether image exists
id: check-container-repo
env:
# https://docs.github.com/en/rest/packages/packages?apiVersion=2022-11-28#list-package-versions-for-a-package-owned-by-an-organization
ORG_PATH: '/orgs/${{ env.ORG_NAME }}/packages/container/${{ env.DATA_IMAGE_NAME }}/versions'
# https://docs.github.com/en/rest/packages/packages?apiVersion=2022-11-28#list-package-versions-for-a-package-owned-by-the-authenticated-user
USER_PATH: '/user/packages/container/${{ env.DATA_IMAGE_NAME }}/versions'
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DATA_IMAGE_TAG: ${{ steps.get-ids-from-package-json.outputs.DATA_IMAGE_TAG }}
run: |
GH_PATH=$( [[ "${{ env.NAMESPACE }}" == "${{ env.ORG_NAME }}" ]] && echo "${{ env.ORG_PATH }}" || echo "${{ env.USER_PATH }}" )

# allow error to handle case where gh throws an error when package has not yet been created
set +e
IMAGE_VERSIONS=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "${GH_PATH}")
set -e

PACKAGE_NOT_FOUND=$(echo "${IMAGE_VERSIONS}" | jq '.message? == "Package not found."')
if [[ "${PACKAGE_NOT_FOUND}" == "true" ]]; then
IMAGE_EXISTS="false"
else
IMAGE_EXISTS=$(echo "${IMAGE_VERSIONS}" | jq '[.[] | select(any(.metadata.container.tags[]; . == "${{ env.DATA_IMAGE_TAG }}"))] | length > 0')
fi

echo "IMAGE_EXISTS=${IMAGE_EXISTS}" >> "$GITHUB_OUTPUT"

build-image:
needs: check-for-image
if: ${{ needs.check-for-image.result == 'success' && needs.check-for-image.outputs.IMAGE_EXISTS == 'false' }}
timeout-minutes: 60
runs-on: ubuntu-20.04
permissions:
packages: write
environment: e2e
env:
LOCAL_DATA_PATH: './local/data'
LOCAL_TEAM_IMAGES_DIR: './local/data/team_images'
LOCAL_COLLECTIONS_PATH: './scripts/collections.csv'
LOCAL_IMPORT_SCRIPT_PATH: './docker/import-data.sh'
LOCAL_CREATE_INDEXES_PATH: './scripts/mongo-create-Indexes.js'
DATA_VERSION: ${{ needs.check-for-image.outputs.DATA_VERSION }}
DATA_MANIFEST_ID: ${{ needs.check-for-image.outputs.DATA_MANIFEST_ID }}
DATA_IMAGE_PATH: ${{ needs.check-for-image.outputs.DATA_IMAGE_PATH }}
steps:
- uses: actions/checkout@v4

# https://github.com/actions/setup-python/issues/807
- name: create placeholder requirements.txt file
run: touch ./requirements.txt

- uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'

- name: install synapseclient
run: |
pip install --upgrade synapseclient

- name: download data from synapse
timeout-minutes: 10
env:
SYNAPSE_AUTH_TOKEN: ${{ secrets.SYNAPSE_AUTH_TOKEN }}
run: |
echo "==> make directory for team images"
mkdir -p "${{ env.LOCAL_TEAM_IMAGES_DIR }}"

echo "==> download manifest file from Synapse"
synapse get --downloadLocation "${{ env.LOCAL_DATA_PATH }}" -v "${{ env.DATA_VERSION }}" "${{ env.DATA_MANIFEST_ID }}"

echo "==> download all files referenced in manifest from Synapse"
cat "${{ env.LOCAL_DATA_PATH }}"/data_manifest.csv | tail -n +2 | while IFS=, read -r id version; do
echo "===> Downloading ${id}.${version}"
synapse get --downloadLocation "${{ env.LOCAL_DATA_PATH }}" -v "${version}" "${id}"
done

echo "==> download team images"
synapse get -r --downloadLocation "${{ env.LOCAL_TEAM_IMAGES_DIR }}/" "${{ vars.TEAM_IMAGES_ID }}"

- name: build image
env:
DOCKERFILE_PATH: './docker/Dockerfile'
run: |
docker build \
-t "${{ env.DATA_IMAGE_PATH }}" \
-f "${{ env.DOCKERFILE_PATH }}" \
--build-arg SOURCE_REPO="https://github.com/${{ github.repository }}" \
--build-arg DESCRIPTION="${GITHUB_SHA::7}" \
--build-arg LOCAL_DATA_PATH="${{ env.LOCAL_DATA_PATH }}" \
--build-arg LOCAL_COLLECTIONS_PATH="${{ env.LOCAL_COLLECTIONS_PATH }}" \
--build-arg LOCAL_IMPORT_SCRIPT_PATH="${{ env.LOCAL_IMPORT_SCRIPT_PATH }}" \
--build-arg LOCAL_CREATE_INDEXES_PATH="${{ env.LOCAL_CREATE_INDEXES_PATH }}" \
.

- name: login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# Note: if a new package is created using this workflow, then the package
# visibility will default to the source repository visibility. For example,
# a package created by a workflow in a public repo will also be public.
# Publicly visible container packages are anonymously downloadable.
- name: push to GitHub Container Registry
run: docker push "${{ env.DATA_IMAGE_PATH }}"

run-e2e-tests:
needs:
- check-for-image
- build-image
# always() prevents skipping this job when build-image was skipped
# see https://github.com/actions/runner/issues/491
if: ${{ always() && needs.check-for-image.result == 'success' && (needs.build-image.result == 'success' || needs.build-image.result == 'skipped')}}
timeout-minutes: 60
runs-on: ubuntu-20.04
permissions:
packages: read
environment: e2e
env:
CI: true
DOCKER_COMPOSE_PATH: './docker/docker-compose.yml'
DATA_IMAGE_PATH: ${{ needs.check-for-image.outputs.DATA_IMAGE_PATH }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASS: ${{ secrets.DB_PASS }}
DB_PORT: ${{ vars.DB_PORT }}
DB_NAME: ${{ vars.DB_NAME }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 16
cache: 'npm'

- name: install dependencies
run: npm ci

- name: install Playwright Browsers
run: npx playwright install --with-deps

- name: login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: start database, server, and app
run: |
echo "==> start database and data containers"
docker compose -f "${{ env.DOCKER_COMPOSE_PATH }}" up -d

echo "==> wait for data container to finish seeding database container"
DATA_CONTAINER=$(docker compose -f "${{ env.DOCKER_COMPOSE_PATH }}" ps -a --format '{{.Name}}' mongo-seed)
docker wait "${DATA_CONTAINER}"

echo "==> start server and app in background and wait for server to grab port"
MONGODB_HOST="localhost" MONGODB_PORT="${{ env.DB_PORT }}" APP_ENV="e2e" npm run dev >/dev/null 2>&1 &
sleep 5

- name: run e2e tests
run: npx playwright test

- name: clean up database, server, and app
run: |
echo "==> stop app"
pid=$(lsof -i :3000 -t) && kill ${pid}

echo "==> stop server"
pid=$(lsof -i :8080 -t) && kill ${pid}

echo "==> stop database"
docker compose -f "${{ env.DOCKER_COMPOSE_PATH }}" down

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 5
55 changes: 0 additions & 55 deletions .github/workflows/node.js.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ testem.log
# System files
.DS_Store
Thumbs.db

# Environment file
.env

Loading
Loading