Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eCR Viewer setup script + variable pattern setting 🖌️ #51

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
13 changes: 5 additions & 8 deletions .github/workflows/dibbsVm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions:
contents: read

jobs:

build:
runs-on: ubuntu-latest

Expand All @@ -25,11 +26,7 @@ jobs:
echo "::set-output name=version::$version"

- name: Build dibbs-vm for dibbs-ecr-viewer
if: ${{ steps.extract.outputs.service == 'dibbs-ecr-viewer' }}
run: |
echo "Building dibbs-vm version ${{ steps.extract.outputs.version }} for ${{ steps.extract.outputs.service }}"

- name: Build dibbs-vm for dibbs-query-connector
if: ${{ steps.extract.outputs.service == 'dibbs-query-connector' }}
run: |
echo "Building dibbs-vm version ${{ steps.extract.outputs.version }} for ${{ steps.extract.outputs.service }}"
uses: ./.github/workflows/packMachines.yml
with:
service: ${{ steps.extract.outputs.service }}
version: ${{ steps.extract.outputs.version }}
41 changes: 34 additions & 7 deletions .github/workflows/packMachines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ on:
push:
branches:
- main
workflow_call:
inputs:
service:
required: true
type: string
version:
required: true
type: string
workflow_dispatch:
inputs:
service:
required: true
type: string
version:
required: true
type: string

permissions:
contents: read
Expand All @@ -28,7 +44,7 @@ jobs:
- provisioners: ${{ inputs.provisioners }}
steps:
- uses: actions/checkout@v4

- name: Set up Packer
uses: hashicorp/setup-packer@1aa358be5cf73883762b302a3a03abd66e75b232
with:
Expand All @@ -39,18 +55,29 @@ jobs:
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25

- name: Run `packer init`
working-directory: ./packer
working-directory: ./packer/ubuntu-server
id: init
run: "packer init ./ubuntu.pkr.hcl"

- name: Run `packer validate`
working-directory: ./packer
working-directory: ./packer/ubuntu-server
id: validate
run: "packer validate ./ubuntu.pkr.hcl"

- name: Build dibbs-ecr-viewer Packer Image
if: github.event_name == 'push'
working-directory: ./packer/ubuntu-server
run: packer build --var-file=dibbs-ecr-viewer.pkr.hcl ./ubuntu.pkr.hcl

## TODO: Add matrixed provisioner build here
- name: Build Packer Image
working-directory: ./packer
run: packer build ./ubuntu.pkr.hcl
- name: Build dibbs-query-connector Packer Image
# if the event is a push to main
if: github.event_name == 'push'
working-directory: ./packer/ubuntu-server
run: packer build --var-file=dibbs-query-connector.pkr.hcl ./ubuntu.pkr.hcl

- name: Build Workflow Call Packer Image
if: github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch'
working-directory: ./packer/ubuntu-server
run: packer build --var dibbs_service=${{ inputs.service }} --var dibbs_version=${{ inputs.version }} ./ubuntu.pkr.hcl

## TODO: Decide how to export artifact.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
packer/ubuntu-server/build/*

docker/dibbs-ecr-viewer/.env
docker/dibbs-ecr-viewer/ecr-viewer.wizard.env
docker/dibbs-ecr-viewer/ecr-viewer.env.bak

docker/dibbs-query-connectory/.env
docker/dibbs-query-connectory/query-connectory.wizard.env
docker/dibbs-query-connectory/query-connectory.env.bak
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'

services:
ecr-viewer:
image: ghcr.io/cdcgov/dibbs-ecr-viewer/ecr-viewer:v2.0.0-beta
image: ghcr.io/cdcgov/$DIBBS_SERVICE/ecr-viewer:$DIBBS_VERSION
restart: always
env_file: "ecr-viewer.env"
ports:
Expand All @@ -11,49 +11,49 @@ services:
- dibbs

ingestion:
image: ghcr.io/cdcgov/dibbs-ecr-viewer/ingestion:v2.0.0-beta
image: ghcr.io/cdcgov/$DIBBS_SERVICE/ingestion:$DIBBS_VERSION
restart: always
ports:
- "8080:8080"
networks:
- dibbs

validation:
image: ghcr.io/cdcgov/dibbs-ecr-viewer/validation:v2.0.0-beta
image: ghcr.io/cdcgov/$DIBBS_SERVICE/validation:$DIBBS_VERSION
restart: always
ports:
- "8081:8080"
networks:
- dibbs

fhir-converter:
image: ghcr.io/cdcgov/dibbs-ecr-viewer/fhir-converter:v2.0.0-beta
image: ghcr.io/cdcgov/$DIBBS_SERVICE/fhir-converter:$DIBBS_VERSION
restart: always
ports:
- "8082:8080"
networks:
- dibbs

message-parser:
image: ghcr.io/cdcgov/dibbs-ecr-viewer/message-parser:v2.0.0-beta
image: ghcr.io/cdcgov/$DIBBS_SERVICE/message-parser:$DIBBS_VERSION
restart: always
ports:
- "8083:8080"
networks:
- dibbs

trigger-code-reference:
image: ghcr.io/cdcgov/dibbs-ecr-viewer/trigger-code-reference:v2.0.0-beta
image: ghcr.io/cdcgov/$DIBBS_SERVICE/trigger-code-reference:$DIBBS_VERSION
restart: always
ports:
- "8084:8080"
networks:
- dibbs

orchestration:
image: ghcr.io/cdcgov/dibbs-ecr-viewer/orchestration:v2.0.0-beta
image: ghcr.io/cdcgov/$DIBBS_SERVICE/orchestration:$DIBBS_VERSION
env_file: "orchestration.env"
restart: always
restart: always
ports:
- "8085:8080"
networks:
Expand Down
22 changes: 22 additions & 0 deletions docker/dibbs-ecr-viewer/ecr-viewer.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
AWS_REGION=${AWS_REGION}
ECR_BUCKET_NAME=${ECR_BUCKET_NAME}

AZURE_STORAGE_CONNECTION_STRING=${AZURE_STORAGE_CONNECTION_STRING}
AZURE_CONTAINER_NAME=${AZURE_CONTAINER_NAME}

HOSTNAME=0.0.0.0

NBS_AUTH=${NBS_AUTH}
NBS_PUB_KEY=${NBS_PUB_KEY}

CONFIG_NAME=${CONFIG_NAME}

DATABASE_URL=${DATABASE_URL}

SQL_SERVER_USER=${SQL_SERVER_USER}
SQL_SERVER_PASSWORD=${SQL_SERVER_PASSWORD}
SQL_SERVER_HOST=${SQL_SERVER_HOST}
DB_CIPHER=${DB_CIPHER}

DIBBS_SERVICE=dibbs-ecr-viewer
DIBBS_VERSION=${DIBBS_VERSION}
Loading