Skip to content

Commit

Permalink
Merge branch 'release/rcnet-v2'
Browse files Browse the repository at this point in the history
  • Loading branch information
dhedey committed Jul 26, 2023
2 parents 4586d93 + a540c05 commit 02b980c
Show file tree
Hide file tree
Showing 1,167 changed files with 99,498 additions and 23,451 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "7.0.4",
"version": "7.0.5",
"commands": [
"dotnet-ef"
]
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/set-variables/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ runs:
DOCKER_TAG=${NORMALIZED_SUFFIX}
VERSION_SUFFIX=${NORMALIZED_SUFFIX}
DOCKER_REPO_DATA_AGGREGATOR="eu.gcr.io/dev-container-repo/babylon-ng-data-aggregator"
DOCKER_REPO_GATEWAY_API="eu.gcr.io/dev-container-repo/babylon-ng-gateway-api"
DOCKER_REPO_DATABASE_MIGRATIONS="eu.gcr.io/dev-container-repo/babylon-ng-database-migrations"
DOCKER_REPO_DATA_AGGREGATOR="docker.io/radixdlt/babylon-ng-data-aggregator"
DOCKER_REPO_GATEWAY_API="docker.io/radixdlt/babylon-ng-gateway-api"
DOCKER_REPO_DATABASE_MIGRATIONS="docker.io/radixdlt/babylon-ng-database-migrations"
case "${GH_EVENT_NAME}" in
release)
VERSION_SUFFIX=""
VERSION_SUFFIX="${{ github.event.release.tag_name }}"
DOCKER_REPO_DATA_AGGREGATOR="radixdlt/babylon-ng-data-aggregator"
DOCKER_REPO_DATABASE_MIGRATIONS="radixdlt/babylon-ng-database-migrations"
Expand Down
82 changes: 52 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,67 +43,82 @@ jobs:
with:
github_event_name: ${{ github.event_name }}
github_action_name: ${{ github.event.action}}
- name: Publish Gateway Settings
uses: actions/upload-artifact@v3
with:
path: Directory.Build.props
name: build_props
retention-days: 1

docker-database-migrations-gcr:
docker-database-migrations-private:
name: (DatabaseMigrations) Docker
needs:
- setup-tags
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-22.04
image_registry: "eu.gcr.io"
image_organization: "dev-container-repo"
image_name: "babylon-ng-database-migrations"
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "private-babylon-ng-database-migrations"
tag: ${{ needs.setup-tags.outputs.database-migrations-tag }}
context: "."
dockerfile: "./apps/DatabaseMigrations/Dockerfile"
platforms: "linux/amd64"
restore_artifact: "true"
artifact_location: "./"
artifact_name: build_props
secrets:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDP }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}

docker-data-aggregator-gcr:
docker-data-aggregator-private:
name: (DataAggregator) Docker
needs:
- setup-tags
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-22.04
image_registry: "eu.gcr.io"
image_organization: "dev-container-repo"
image_name: "babylon-ng-data-aggregator"
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "private-babylon-ng-data-aggregator"
tag: ${{ needs.setup-tags.outputs.data-aggregator-tag }}
context: "."
dockerfile: "./apps/DataAggregator/Dockerfile"
platforms: "linux/amd64"
restore_artifact: "true"
artifact_location: "./"
artifact_name: build_props
secrets:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDP }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}

docker-gateway-api-gcr:
docker-gateway-api-private:
name: (GatewayApi) Docker
needs:
- setup-tags
uses: radixdlt/public-iac-resuable-artifacts/.github/workflows/docker-build.yml@main
with:
runs_on: ubuntu-22.04
image_registry: "eu.gcr.io"
image_organization: "dev-container-repo"
image_name: "babylon-ng-gateway-api"
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "private-babylon-ng-gateway-api"
tag: ${{ needs.setup-tags.outputs.gateway-api-tag }}
context: "."
dockerfile: "./apps/GatewayApi/Dockerfile"
platforms: "linux/amd64"
restore_artifact: "true"
artifact_location: "./"
artifact_name: build_props
secrets:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDP }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}

deploy-on-mardunet:
runs-on: ubuntu-22.04
needs:
- docker-gateway-api-gcr
- docker-data-aggregator-gcr
- docker-database-migrations-gcr
- docker-gateway-api-private
- docker-data-aggregator-private
- docker-database-migrations-private
- setup-tags
if: github.ref == 'refs/heads/develop'
permissions:
Expand All @@ -112,7 +127,7 @@ jobs:
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: ./.github/actions/fetch-secrets
with:
with:
role_name: "arn:aws:iam::308190735829:role/gh-babylon-gateway-secrets-read-access"
app_name: "babylon-gateway"
step_name: "deploy-on-mardunet"
Expand All @@ -123,6 +138,12 @@ jobs:
run: |
export $(grep -v '^#' ./deployment/ci.env | xargs)
echo "FULLNODE_VERSION=$FULLNODE_VERSION" >> $GITHUB_ENV
- name: Check if ci.env changed
id: changed-files
uses: tj-actions/changed-files@db5dd7c176cf59a19ef6561bf1936f059dee4b74
with:
files: |
deployment/ci.env
- name: Trigger deployment event ${{ github.ref }}
env:
NAMESPACE: "ng-mardunet"
Expand All @@ -136,6 +157,7 @@ jobs:
"event_type": "${{env.EVENT_TYPE}}",
"client_payload": {
"namespace_postfix": "${{env.NAMESPACE}}",
"ci_env_changed": "${{steps.changed-files.outputs.any_changed}}",
"data_aggregator_image_tag": "${{ needs.setup-tags.outputs.data-aggregator-tag }}",
"gateway_api_image_tag": "${{ needs.setup-tags.outputs.gateway-api-tag }}",
"database_migrations_image_tag": "${{ needs.setup-tags.outputs.database-migrations-tag }}",
Expand All @@ -146,18 +168,18 @@ jobs:
ephemeral-deploy-and-benchmark:
runs-on: ubuntu-22.04
needs:
- docker-gateway-api-gcr
- docker-data-aggregator-gcr
- docker-database-migrations-gcr
- docker-gateway-api-private
- docker-data-aggregator-private
- docker-database-migrations-private
- setup-tags
if: github.ref == 'refs/heads/develop'
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: ./.github/actions/fetch-secrets
with:
with:
role_name: "arn:aws:iam::308190735829:role/gh-babylon-gateway-secrets-read-access"
app_name: "babylon-gateway"
step_name: "ephemeral-deploy-and-benchmark"
Expand Down Expand Up @@ -193,9 +215,9 @@ jobs:
deploy-pr:
runs-on: ubuntu-22.04
needs:
- docker-gateway-api-gcr
- docker-data-aggregator-gcr
- docker-database-migrations-gcr
- docker-gateway-api-private
- docker-data-aggregator-private
- docker-database-migrations-private
- setup-tags
if: github.event_name == 'pull_request'
permissions:
Expand All @@ -204,7 +226,7 @@ jobs:
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: ./.github/actions/fetch-secrets
with:
with:
role_name: "arn:aws:iam::308190735829:role/gh-babylon-gateway-secrets-read-access"
app_name: "babylon-gateway"
step_name: "deploy-pr"
Expand Down Expand Up @@ -236,9 +258,9 @@ jobs:
ephemeral-deploy-and-test:
runs-on: ubuntu-22.04
needs:
- docker-gateway-api-gcr
- docker-data-aggregator-gcr
- docker-database-migrations-gcr
- docker-gateway-api-private
- docker-data-aggregator-private
- docker-database-migrations-private
- setup-tags
if: github.event_name == 'pull_request'
permissions:
Expand All @@ -247,7 +269,7 @@ jobs:
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: ./.github/actions/fetch-secrets
with:
with:
role_name: "arn:aws:iam::308190735829:role/gh-babylon-gateway-secrets-read-access"
app_name: "babylon-gateway"
step_name: "ephemeral-deploy-and-test"
Expand Down Expand Up @@ -288,7 +310,7 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: ./.github/actions/fetch-secrets
with:
with:
role_name: "arn:aws:iam::308190735829:role/gh-common-secrets-read-access"
app_name: "babylon-gateway"
step_name: "sonarcloud"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/publish-typescript-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ jobs:
- run: cat $NPM_CONFIG_USERCONFIG
- name: Build alphanet-gateway-sdk
run: |
yarn
yarn build
npm ci
npm run build
npm run test
- name: Setup tags for npm
id: setup_tags
Expand Down
64 changes: 20 additions & 44 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,19 @@ jobs:
runs-on: ubuntu-22.04
environment: release
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Setup .NET SDK
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2
with:
dotnet-version: 7.0.x
- name: Get release
id: get_release
uses: bruceadams/get-release@f589ce0779c7bef1faf175f7488c972eb47dc046
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build linux binaries
run: |
cd apps/DataAggregator
dotnet publish --runtime linux-x64 --configuration Release --self-contained false -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false --output ./output
dotnet publish --runtime linux-x64 --configuration Release --self-contained false -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false --output ./output
cd ../DatabaseMigrations
dotnet publish --runtime linux-x64 --configuration Release --self-contained false -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false --output ./output
dotnet publish --runtime linux-x64 --configuration Release --self-contained false -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false --output ./output
cd ../GatewayApi
dotnet publish --runtime linux-x64 --configuration Release --self-contained false -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false --output ./output
dotnet publish --runtime linux-x64 --configuration Release --self-contained false -p:PublishReadyToRun=true -p:DebugType=None -p:DebugSymbols=false --output ./output
cd ../..
zip -r data-aggregator.zip apps/DataAggregator/output/
zip -r database-migrations.zip apps/DatabaseMigrations/output/
Expand All @@ -44,7 +39,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./gateway-api.zip
asset_name: gateway-api-${{ github.event.release.tag_name }}-linux-x64.zip
asset_content_type: application/zip
Expand All @@ -53,17 +48,15 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./database-migrations.zip
asset_name: database-migrations-${{ github.event.release.tag_name }}-linux-x64.zip
asset_content_type: application/zip

setup-tags:
runs-on: ubuntu-22.04
outputs:
database-migrations-tag: ${{ steps.setup_tags.outputs.database-migrations-tag }}
data-aggregator-tag: ${{ steps.setup_tags.outputs.data-aggregator-tag }}
gateway-api-tag: ${{ steps.setup_tags.outputs.gateway-api-tag }}
version-suffix: ${{ steps.setup_tags.outputs.version-suffix }}
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Get rele ase
Expand All @@ -77,28 +70,11 @@ jobs:
with:
github_event_name: ${{ github.event_name }}
github_action_name: ${{ github.event.action}}
- name: Setup application version
run: |
echo "$( jq '.+{DataAggregatorVersion:"${{ steps.get_release.outputs.tag_name }}"}' apps/DataAggregator/appsettings.json )" > src/DataAggregator/appsettings.json
echo "$( jq '.+{DatabaseMigrationsVersion:"${{ steps.get_release.outputs.tag_name }}"}' apps/DatabaseMigrations/appsettings.json )" > src/DatabaseMigrations/appsettings.json
echo "$( jq '.+{GatewayApiVersion:"${{ steps.get_release.outputs.tag_name }}"}' apps/GatewayApi/appsettings.json )" > src/GatewayAPI/appsettings.json
- name: Publish Gateway Settings
uses: actions/upload-artifact@v3
with:
path: src/GatewayAPI/appsettings.json
name: gateway
retention-days: 1
- name: Publish DatabaseMigrations Settings
uses: actions/upload-artifact@v3
with:
path: src/DatabaseMigrations/appsettings.json
name: migrations
retention-days: 1
- name: Publish DataAggregator Settings
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
path: src/DataAggregator/appsettings.json
name: aggregator
path: Directory.Build.props
name: build_props
retention-days: 1

docker-database-migrations-dockerhub:
Expand All @@ -111,16 +87,16 @@ jobs:
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-ng-database-migrations"
tag: ${{ needs.setup-tags.outputs.database-migrations-tag }}
tag: ${{ needs.setup-tags.outputs.version-suffix }}
context: "."
dockerfile: "./apps/DatabaseMigrations/Dockerfile"
platforms: "linux/amd64"
environment: release
cache_tag_suffix: "release"
enable_dockerhub: "true"
restore_artifact: "true"
artifact_location: "src/DatabaseMigrations/appsettings.json"
artifact_name: "migrations"
artifact_location: "./"
artifact_name: build_props
secrets:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDP }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
Expand All @@ -136,16 +112,16 @@ jobs:
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-ng-data-aggregator"
tag: ${{ needs.setup-tags.outputs.data-aggregator-tag }}
tag: ${{ needs.setup-tags.outputs.version-suffix }}
context: "."
dockerfile: "./apps/DataAggregator/Dockerfile"
platforms: "linux/amd64"
environment: release
cache_tag_suffix: "release"
enable_dockerhub: "true"
restore_artifact: "true"
artifact_location: "src/DataAggregator/appsettings.json"
artifact_name: "aggregator"
artifact_location: "./"
artifact_name: build_props
secrets:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDP }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
Expand All @@ -161,16 +137,16 @@ jobs:
image_registry: "docker.io"
image_organization: "radixdlt"
image_name: "babylon-ng-gateway-api"
tag: ${{ needs.setup-tags.outputs.gateway-api-tag }}
tag: ${{ needs.setup-tags.outputs.version-suffix }}
context: "."
dockerfile: "./apps/GatewayApi/Dockerfile"
platforms: "linux/amd64"
environment: release
cache_tag_suffix: "release"
enable_dockerhub: "true"
restore_artifact: "true"
artifact_location: "src/GatewayAPI/appsettings.json"
artifact_name: "gateway"
artifact_location: "./"
artifact_name: build_props
secrets:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDP }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
Expand Down
Loading

0 comments on commit 02b980c

Please sign in to comment.