Skip to content

chanzuckerberg/czid-platformics

Repository files navigation

CZ ID Platformics

  • A repository that contains graphql services to manage and create workflows and entities for use with the CZ ID application.

Setup

To start both the entities and workflows services use

make init

Note that the Redis port of czid-web and workflows are the same, so if the initialization fails, you can stop the czid-web redis container and try again.

Running

After the services are running, the graphql services have endpoints at

http://localhost:8008/graphql ## entities
http://localhost:8042/graphql ## workflows

for entities and workflows respectively.

To generate a token for entities GQL queries:

cd entities/

# This will copy `{"Authorization": "<token>"}` to your clipboard, which you can paste into the GraphQL UI, under "Headers" at the bottom
make local-token

Entities

Deployment

This project uses happy for cloud deployment. The happy environments are defined in the idseq-infra repo.

Deploying to live environments

We have defined GitHub Actions for deploying the services in each environment. To trigger these actions:

  1. Select the appropriate workflow for the environment you want to deploy to (for example, Deploy to Sandbox)
  2. Click Run workflow.
  3. Select the branch you want to deploy. The default is main.
  4. Select which service (entities or workflows) to deploy.
    • Note: When possible, it's recommended to deploy both services to ensure that changes are in sync.
  5. Click the green Run workflow button.

Manual deployments

Create a new stack:

  1. Make sure you have happy installed. You can follow the installation instructions for happy here.
  2. Run happy create <your-stack-name> -env [dev, sandbox, staging, prod] in the directory of the service you want to start (either entities or workflows).
  3. You should be able to see the service running at <your-stack-name>.<env>.happy.czid.org/graphql.
  4. If migrations still need to be run, you can run them with happy migrate <your-stack-name> –env [dev, sandbox, staging, prod].
    • If the job fails, you can also run migrations by shelling into the container with happy shell <your-stack-name> [workflows/entities] –env [dev, sandbox, staging, prod] and running sh scripts/migrate.sh.
  5. If you need seed data, shell into the container with happy shell <your-stack-name> [workflows/entities] –env [dev, sandbox, staging, prod] then run python3 scripts/seed.py.
  6. If you need seeded workflow versions/entities to run a workflow, shell into the container with happy shell <your-stack-name> [workflows/entities] –env [dev, sandbox, staging, prod] and run python3 scripts/seed/[consensus-genome, bulk-downloads, etc].

Shell into a stack:

happy shell <your-stack-name> [workflows/entities] –env [dev, sandbox, staging, prod]

Update an existing stack:

happy update <your-stack-name> –env [dev, sandbox, staging, prod]

Get logs from a stack:

happy logs <your-stack-name> <entities/workflows> --env [dev, sandbox, staging, prod]

For more information on happy, read their docs here.

Contributing

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Reporting Security Issues

Please disclose security issues responsibly by contacting [email protected].

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published