Add feature_type column to var (#1310) #2582
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python cell_census build | |
on: | |
pull_request: | |
paths: | |
- "api/python/**" | |
- "tools/cellxgene_census_builder/**" | |
- ".github/workflows/**" # Re-run if a workflow is modified - useful to test workflow changes in PRs | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build_python_wheels: | |
name: Build Python wheel and sdist | |
runs-on: [self-hosted, Linux, X64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install deps | |
run: | | |
python -m pip install -U pip setuptools build | |
- name: Build | |
run: python -m build | |
working-directory: api/python/cellxgene_census/ | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: api/python/cellxgene_census/dist/* | |
build_docker_container: | |
name: Build Docker image for Census Builder | |
runs-on: [self-hosted, Linux, X64] | |
permissions: # these permissions must be set for AWS auth to work! | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-west-2 | |
role-to-assume: ${{ secrets.AWS_PROD_ROLE_TO_ASSUME }} | |
role-session-name: PushDockerImage | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
- name: Install up-to-date docker buildx | |
run: | | |
# In lieu of having docker buildx plugin installed on our base runner image, | |
# install it manually. https://docs.docker.com/engine/install/ubuntu/ | |
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do | |
sudo apt-get remove $pkg || echo "${pkg} not installed" | |
done | |
sudo apt-get update | |
sudo apt-get install -y ca-certificates curl | |
sudo install -m 0755 -d /etc/apt/keyrings | |
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
sudo chmod a+r /etc/apt/keyrings/docker.asc | |
# Add the repository to Apt sources: | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt-get update | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
- name: Install python deps | |
run: | | |
python -m pip install -U pip setuptools build | |
- name: Build package | |
run: python -m build | |
working-directory: tools/cellxgene_census_builder/ | |
- name: Build and tag docker image to Amazon ECR | |
env: | |
REGISTRY: ${{ secrets.ECR_PROD_REGISTRY }} | |
REPOSITORY: cellxgene-census-builder | |
run: | | |
GIT_SHA=$(git rev-parse --short HEAD) | |
docker build --build-arg=COMMIT_SHA=$GIT_SHA -t $REGISTRY/$REPOSITORY:$GIT_SHA . | |
working-directory: tools/cellxgene_census_builder/ | |
- name: Push docker image to Amazon ECR | |
if: ${{ github.ref == 'refs/heads/main' }} | |
env: | |
REGISTRY: ${{ secrets.ECR_PROD_REGISTRY }} | |
REPOSITORY: cellxgene-census-builder | |
run: | | |
GIT_SHA=$(git rev-parse --short HEAD) | |
docker push $REGISTRY/$REPOSITORY:$GIT_SHA | |
docker tag $REGISTRY/$REPOSITORY:$GIT_SHA $REGISTRY/$REPOSITORY:latest | |
docker push $REGISTRY/$REPOSITORY:latest |