Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@ updates:
cooldown:
default-days: 7

# Enable version updates for Docker
# Enable version updates for Python (API)
- package-ecosystem: "uv"
# Look for a `Dockerfile` in the `root` directory
# Look for a `pyproject.toml` in the `root` directory
directory: "/"
# Check for updates once a week
schedule:
interval: "weekly"
cooldown:
default-days: 7

# Enable version updates for Python (research)
- package-ecosystem: "uv"
# Look for a `pyproject.toml` in the research directory
directory: "terraform/research"
# Check for updates once a week
schedule:
interval: "weekly"
cooldown:
default-days: 7
7 changes: 0 additions & 7 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ jobs:
ref: ${{github.head_ref}}
lfs: true

- name: Set up SSH
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: |
${{ secrets.SSH_BC2_DEPLOY_PRIVATE_KEY }}

- name: Set up Terraform
uses: hashicorp/setup-terraform@v3

Expand All @@ -42,7 +36,6 @@ jobs:
- name: Get requirements
working-directory: ${{env.wd}}
run: |
git config --global url."https://x-token-auth:${{ secrets.GH_PAT }}@github.com/".insteadOf "git@github.com:"
uv sync --locked --all-extras --dev

- name: Linting, formatting, and type checking
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,44 +95,9 @@ jobs:
username: blindchargingapi
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}

- name: Set up SSH
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: |
${{ secrets.SSH_ALLIGATER_DEPLOY_PRIVATE_KEY }}
${{ secrets.SSH_BC2_DEPLOY_PRIVATE_KEY }}

# The webfactory/ssh-agent step generates a .gitconfig and .ssh/config
# that need to be 1) copied into the build context, and 2) injected into
# the Dockerfile so that the build can access private repositories.
- name: Patch git and ssh in Dockerfile
env:
DIR: ${{github.workspace}}
run: |
mkdir -p custom-config
cp -r ~/.gitconfig ~/.ssh custom-config/
ed -s $DIR/Dockerfile <<EOF
/WORKDIR/
i
COPY custom-config/.gitconfig /root/.gitconfig
COPY custom-config/.ssh /root/.ssh
RUN sed 's|/home/runner|/root|g' -i.bak /root/.ssh/config
.
w
q
EOF
ls -l custom-config/.ssh
cat custom-config/.ssh/config
cat custom-config/.gitconfig

- name: Build and push API image
uses: docker/build-push-action@v6
with:
# Use the configured ssh-agent in the build for private repos.
ssh: default=${{ env.SSH_AUTH_SOCK }}
# Override default context to use the checkout with Dockerfile modifications.
context: ${{github.workspace}}
file: ${{github.workspace}}/Dockerfile
# Apply new version tag, as well as a tag based on release channel.
push: true
tags: blindchargingapi.azurecr.io/blind-charging-api:${{ needs.tag.outputs.api_release_channel }},blindchargingapi.azurecr.io/blind-charging-api:${{ needs.tag.outputs.api_version }}
Comment on lines 95 to 103

This comment was marked as outdated.

Expand Down
38 changes: 2 additions & 36 deletions .github/workflows/research.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,45 +34,11 @@ jobs:
username: blindchargingapi
password: ${{ secrets.AZURE_REGISTRY_PASSWORD }}

- name: Set up SSH
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: |
${{ secrets.SSH_ALLIGATER_DEPLOY_PRIVATE_KEY }}
${{ secrets.SSH_BC2_DEPLOY_PRIVATE_KEY }}

# The webfactory/ssh-agent step generates a .gitconfig and .ssh/config
# that need to be 1) copied into the build context, and 2) injected into
# the Dockerfile so that the build can access private repositories.
- name: Patch git and ssh in Dockerfile
env:
DIR: ${{github.workspace}}
run: |
CONFIG_DIR=terraform/research/custom-config
mkdir -p $CONFIG_DIR
cp -r ~/.gitconfig ~/.ssh $CONFIG_DIR/
ed -s $DIR/terraform/research/Dockerfile <<EOF
/WORKDIR/
i
COPY custom-config/.gitconfig /root/.gitconfig
COPY custom-config/.ssh /root/.ssh
RUN sed 's|/home/runner|/root|g' -i.bak /root/.ssh/config
.
w
q
EOF
ls -l $CONFIG_DIR/.ssh
cat $CONFIG_DIR/.ssh/config
cat $CONFIG_DIR/.gitconfig

- name: Build and push research image
uses: docker/build-push-action@v6
with:
# Use the configured ssh-agent in the build for private repos.
ssh: default=${{ env.SSH_AUTH_SOCK }}
# Override default context to use the checkout with Dockerfile modifications.
context: ${{github.workspace}}/terraform/research
file: ${{github.workspace}}/terraform/research/Dockerfile
context: terraform/research
file: terraform/research/Dockerfile
# Apply new version tag and replace any existing `latest` tag.
push: true
tags: blindchargingapi.azurecr.io/blind-charging-research:latest
Comment on lines 34 to 44

This comment was marked as outdated.

Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
"kombu @ git+https://github.com/jnu/kombu.git@bb38b12eec4b79dc95caf75bf4ccdd12a78216c1",
"celery==5.4",
"tiktoken>=0.12.0",
"bc2",
"bc2 @ git+https://github.com/comppolicylab/bc2.git",
]
name = "blind-charging-api"
version = "0.12.9"
Expand Down Expand Up @@ -73,6 +73,3 @@ exclude = "^(alembic)"
[[tool.mypy.overrides]]
module = "app.server.generated.models"
ignore_errors = true

[tool.uv.sources]
bc2 = { git = "ssh://git@github.com/comppolicylab/bc2.git" }
4 changes: 2 additions & 2 deletions terraform/research/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ authors = [
]
requires-python = "<4.0,>=3.12"
dependencies = [
"alligater @ git+ssh://git@github.com/stanford-policylab/alligater.git",
"bc2 @ git+ssh://git@github.com/stanford-policylab/bc2.git",
"alligater @ git+https://github.com/comppolicylab/alligater.git",
"bc2 @ git+https://github.com/comppolicylab/bc2.git",
]
name = "research"
version = "0.1.0"
Expand Down
Loading
Loading