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

feat: adds blueprints | NPG-000 #741

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:
- uses: actions/checkout@v4

- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.5.3
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.7.1
with:
version: 0.8.0
version: 0.14.0
if: always()

- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.5.3
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.7.1

- name: Run tests
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.5.3
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.7.1
if: always()
continue-on-error: true
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ permissions:

jobs:
ci:
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.5.3
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.7.1
with:
forge_version: 0.8.1
forge_version: 0.14.0
8 changes: 4 additions & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ all:
END

# Build and tag all Docker images
BUILD ./containers/event-db-migrations+publish --tag=$tag --registry=$registry_final
BUILD ./containers/event-db-migrations+package --tag=$tag --registry=$registry_final

# Build crate images from the workspace
BUILD ./src/jormungandr/jormungandr+docker --tag=$tag --registry=$registry_final
Expand All @@ -101,7 +101,7 @@ all:
BUILD ./src/voting-tools-rs+docker --tag=$tag --registry=$registry_final
BUILD ./src/cat-data-service+publish --tag=$tag --registry=$registry_final

BUILD ./services/voting-node+publish --tag=$tag --registry=$registry_final
BUILD ./services/voting-node+package --tag=$tag --registry=$registry_final
BUILD ./utilities/ideascale-importer+docker --tag=$tag --registry=$registry_final

all-with-tags:
Expand Down Expand Up @@ -147,9 +147,9 @@ tag-workspace:

local:
LOCALLY
BUILD ./containers/event-db-migrations+publish
BUILD ./containers/event-db-migrations+package
BUILD ./src/cat-data-service+publish
BUILD ./services/voting-node+publish
BUILD ./services/voting-node+package

RUN mkdir -p ./local
COPY ./containers/dev-local+build/docker-compose.yml ./local/
60 changes: 60 additions & 0 deletions blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: "1.0"
global: {
ci: {
local: [
"^check(-.*)?$",
"^build(-.*)?$",
"^package(-.*)?$",
"^test(-.*)?$",
]
registries: [
ci.providers.aws.ecr.registry,
]
providers: {
aws: {
region: "eu-central-1"
ecr: registry: "332405224602.dkr.ecr.eu-central-1.amazonaws.com"
role: "arn:aws:iam::332405224602:role/ci"
}

docker: credentials: {
provider: "aws"
path: "global/ci/docker"
}

git: credentials: {
provider: "aws"
path: "global/ci/deploy"
}

earthly: {
credentials: {
provider: "aws"
path: "global/ci/earthly"
}
org: "Catalyst"
satellite: "ci"
version: "0.8.15"
}

github: registry: "ghcr.io"

kcl: {
install: true
version: "v0.11.0"
}
}
secrets: [
{
name: "GITHUB_TOKEN"
optional: true
provider: "env"
path: "GITHUB_TOKEN"
},
]
}
repo: {
defaultBranch: "main"
name: "input-output-hk/catalyst-core"
}
}
10 changes: 9 additions & 1 deletion containers/event-db-migrations/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:
SAVE ARTIFACT ./bin/refinery refinery
SAVE IMAGE --cache-hint

publish:
package:
FROM debian:stable-slim
ARG tag="latest"
ARG data="historic"
Expand Down Expand Up @@ -63,3 +63,11 @@ publish:
# --load test:latest=+docker
# RUN docker run test:latest
# END

docker:
FROM +package

ARG container='migrations'
ARG tag="latest"

SAVE IMAGE ${container}:${tag}
15 changes: 15 additions & 0 deletions containers/event-db-migrations/blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "1.0.0"
project: {
name: "event-db-migrations"
release: {
docker: {
on: {
merge: {}
tag: {}
}
config: {
tag: _ @forge(name="GIT_HASH_OR_TAG")
}
}
}
}
12 changes: 10 additions & 2 deletions services/voting-node/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ deps:
# Install package dependencies without the voting_node package
RUN poetry install --only main --no-root
RUN poetry self add poetry-plugin-export

# Copy the voting_node source code
COPY --dir voting_node README.md ./

Expand Down Expand Up @@ -91,7 +91,7 @@ pdoc:
SAVE ARTIFACT /doc

# Docker image built for distribution and use in production.
publish:
package:
FROM python:3.11-slim-bullseye
ARG tag="latest"

Expand Down Expand Up @@ -165,3 +165,11 @@ integration-test:
--service leader0
RUN docker-compose run leader0 echo "<<<INTEGRATION TESTING GOES HERE>>>"
END

docker:
FROM +package

ARG container='voting-node'
ARG tag="latest"

SAVE IMAGE ${container}:${tag}
15 changes: 15 additions & 0 deletions services/voting-node/blueprint.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "1.0.0"
project: {
name: "voting-node"
release: {
docker: {
on: {
merge: {}
tag: {}
}
config: {
tag: _ @forge(name="GIT_HASH_OR_TAG")
}
}
}
}
106 changes: 0 additions & 106 deletions src/event-db/migrations/V11__reviews.sql

This file was deleted.

45 changes: 0 additions & 45 deletions src/event-db/migrations/V4__catalyst_id.sql

This file was deleted.

Loading
Loading