Skip to content
MetaCellPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

146 Commits

Folders and files

Repository files navigation

IDP-ARC (Vite + Cloudharness)

This repo contains the IDP-ARC frontend, scaffolded with Vite + React, and wired up to deploy using Cloudharness + Codefresh pattern The frontend lives here:

applications/idp-arc/frontend

The app image is built here:

applications/idp-arc/Dockerfile

Cloudharness generates the Helm chart into:

deployment/helm

Project Structure

applications/
  idp-arc/
    frontend/               # Vite + React app
    Dockerfile              # Builds frontend with Cloudharness frontend-build
deployment/
  codefresh-dev.yaml        # Codefresh pipeline (dev)
deployment/helm/            # Generated by harness-deployment

Local Development (Frontend)

From repo root:

cd applications/idp-arc/frontend
yarn install --frozen-lockfile
yarn dev

Then open:

http://localhost:5173

Build:

yarn build

Preview production build locally:

yarn preview

Unit tests (no browser, no backend):

yarn test:unit

Uploads go to one of two places, chosen at build time by VITE_UPLOAD_BACKEND: bucket, or EMBER-DANDI for any other value, including when it isn't set (the default). If the chosen backend lacks what it needs (VITE_EMBER_CLIENT_ID for EMBER-DANDI, VITE_UPLOAD_BUCKET_URL for the bucket), the rest of the site works, and signing in to EMBER-DANDI or uploading says uploads aren't set up; the console names the missing variable. Either way, OSB imports the file into the researcher's workspace from there.

  • ember (default): EMBER-DANDI, into the researcher's own dandiset and the protocol's MAABCD dandiset (maabcdAggregateDandisetId in src/data/protocols.json). Needs both logins (EMBER-DANDI and OSB), VITE_EMBER_CLIENT_ID, an EMBER-DANDI OAuth application (public client, PKCE) with <this app's origin>/ember-callback as a redirect URI, and, for the MAABCD copy, the DANDI_API_KEY attribute on the OSB user named by MAABCD_EMBER_USERNAME (container.ts).
  • bucket: a public bucket open for anonymous writes, named by VITE_UPLOAD_BUCKET_URL. Its CORS must allow PUT from this app's origin. Needs only the OSB login.

Testing on a sandbox (local only)

Deployments always use EMBER-DANDI. To test on a sandbox instead, add this to applications/idp-arc/frontend/.env.local and restart yarn start:dev:

# dandi-sandbox or ember-dandi-sandbox
VITE_DANDI_INSTANCE=dandi-sandbox

MAABCD copies then go to the protocol's dandiset for that sandbox in src/data/protocols.json (none listed: nothing is shared).

The sandboxes have no OAuth app for us, so also add your API key on that sandbox there. The dev server signs DANDI calls with it, so it never reaches the browser, and yarn build ignores it:

DANDI_SANDBOX_API_KEY=<your sandbox API key>

Docker (Local Build + Run)

This project builds the frontend using the Cloudharness builder image and serves the output using nginx (unprivileged).

1) Clone Cloudharness (locally)

From repo root:

git clone https://github.com/MetaCell/cloud-harness.git
cd cloud-harness
git checkout develop
cd ..

2) Build the Cloudharness frontend builder image

docker build \
  -f cloud-harness/infrastructure/base-images/cloudharness-frontend-build/Dockerfile \
  -t cloudharness-frontend-build:local \
  cloud-harness

3) Build the IDP-ARC app image

docker build \
  -f applications/idp-arc/Dockerfile \
  -t idp-arc:local \
  --build-arg CLOUDHARNESS_FRONTEND_BUILD=cloudharness-frontend-build:local \
  applications/idp-arc

4) Run the container

docker run --rm -p 8080:8080 idp-arc:local

Open:

http://localhost:8080

Codefresh Pipeline (Dev)

The dev pipeline is defined here:

deployment/codefresh-dev.yaml

It follows the same Cloudharness flow used in virtual-fly-brain and other MetaCell apps.

Stages

1) prepare

  • clones this repo
  • clones cloud-harness at ${CLOUDHARNESS_BRANCH}
  • installs Cloudharness tooling
  • runs harness-deployment to generate deployment/helm
  • renders the chart (helm template) for debugging

2) build

  • builds:

    • idp-arc/cloudharness-frontend-build:${CF_BUILD_ID}
    • idp-arc/idp-arc:${CF_BUILD_ID}

3) deploy

  • installs/upgrades the Helm release using:

    • deployment/helm
    • deployment/helm/values.yaml

4) publish

  • pushes the images to the publish registry when ${DEPLOYMENT_PUBLISH_TAG} is set

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages