Skip to content

Commit

Permalink
chore: implement CloudFormation stack for deploying the install scrip…
Browse files Browse the repository at this point in the history
…t on the vantagecompute.ai domain. (#32)

This commit implements a CloudFormation stack whose purpose is to publish the `deploy-democluster.sh`
script on the `vantagecompute.ai` domain. As well as, a new job is added in both the `Linter` and
`Build and Publish democluster to s3` workflows.
  • Loading branch information
matheushent authored Feb 13, 2025
1 parent b481a1a commit e215da8
Show file tree
Hide file tree
Showing 7 changed files with 471 additions and 11 deletions.
54 changes: 46 additions & 8 deletions .github/workflows/build-and-publish-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ on:
branches:
- main
workflow_dispatch:
inputs:
jobbergate_version:
description: The Jobbergate agent version
required: false
type: string
default: 4.3.1

jobs:
build-image-in-lxd:
Expand All @@ -26,8 +20,6 @@ jobs:
poetry install
- name: Build democluster
env:
JG_VERSION: ${{ github.event.inputs.jobbergate_version }}
run: |
poetry run image-factory build democluster
Expand All @@ -40,3 +32,49 @@ jobs:
aws s3 sync democluster/final \
s3://omnivector-public-assets/cloud-images/democluster/latest \
--acl public-read --follow-symlinks --delete 1> /dev/null
install-script-cd:
name: install-script-cd
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v3

- uses: actions/setup-node@v4
with:
node-version: '22.8.0'

- name: Install Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.8.3

- name: Set up Python
uses: actions/setup-python@v4
with:
cache: 'poetry'

- name: Install CDK
run: |
npm install -g [email protected]
- name: Cache cdk.out
uses: actions/cache@v4
with:
path: cdk.out
key: cdk-out

- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Install Python packages
run: |
poetry install --with=website
- name: Publish the deploy script
run: |
cdk deploy --path-metadata false --version-reporting false --require-approval never DemoclusterWebsite
46 changes: 46 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,49 @@ jobs:
run: |
poetry run mypy image_factory --pretty
poetry run ruff check image_factory
synth-stack:
name: synth-stack
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v3

- uses: actions/setup-node@v4
with:
node-version: '22.8.0'

- name: Install Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.8.3

- name: Set up Python
uses: actions/setup-python@v4
with:
cache: 'poetry'

- name: Install CDK
run: |
npm install -g [email protected]
- name: Cache cdk.out
uses: actions/cache@v4
with:
path: cdk.out
key: cdk-out

- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Install Python packages
run: |
poetry install --with=website
- name: Publish the deploy script
run: |
cdk synth --path-metadata false --version-reporting false
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ output-*
*.fd
seeds-cloudimg.iso
*.tar.gz
*.img
*.img

cdk.out/
6 changes: 6 additions & 0 deletions cdk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"app":"poetry run python3 ./website.py",
"context":{
"@aws-cdk/core:newStyleStackSynthesis":true
}
}
Loading

0 comments on commit e215da8

Please sign in to comment.