forked from axelarnetwork/axelar-amplifier
-
Notifications
You must be signed in to change notification settings - Fork 0
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: ampd deployment k8s #16
Draft
eloylp
wants to merge
10
commits into
solana
Choose a base branch
from
ampd-deployment-k8s
base: solana
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
057b195
Add workflow for ampd deployment
eloylp fa5264e
be able to test the ci in the current branch
eloylp b99d5db
Add dummy type for the CI
eloylp 9f59867
Fix ci dependency error
eloylp 1b1d891
ci trigger2
eloylp 1192a03
Move dependency for public fetching
eloylp f085785
Align Solana code with latest solana-axelar changes
eloylp 89c1c6e
Fix clippy warnings
eloylp e77d253
Add periodic tofnd dependency k8 deployment
eloylp 5a1809b
Add periodic dependency check for ampd
eloylp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Ampd deployment | ||
on: | ||
push: | ||
branches: | ||
- "ampd-deployment-k8s" | ||
paths: | ||
- "ampd/**" | ||
|
||
env: | ||
# If one change any variable of this env block, all of them needs to be aligned, as | ||
# we cannot re-user them. | ||
IMAGE_NAME: ampd | ||
IMAGE_VERSION: ${{ github.sha }} | ||
IMAGE_ID: solanaaxelartestnetregistry.azurecr.io/solana-axelar/ampd | ||
DEPLOYING_IMAGE_FQDN: solanaaxelartestnetregistry.azurecr.io/solana-axelar/ampd:${{ github.sha }} | ||
|
||
jobs: | ||
docker-image: | ||
runs-on: ubuntu-latest | ||
name: "Build and push docker image" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-all-crates: true | ||
cache-on-failure: true | ||
workspaces: "ampd -> target" | ||
shared-key: "ampd" | ||
|
||
- name: Build image | ||
run: docker build . --file ampd/Dockerfile --tag $IMAGE_NAME --tag latest | ||
|
||
- name: Login to Azure Container Registry | ||
uses: azure/docker-login@v1 | ||
with: | ||
login-server: ${{ secrets.ACR_REGISTRY_NAME }}.azurecr.io | ||
username: ${{ secrets.AZ_SP_CLIENT_ID }} | ||
password: ${{ secrets.AZ_SP_CLIENT_SECRET }} | ||
|
||
- name: Push image | ||
run: | | ||
docker tag $IMAGE_NAME $IMAGE_ID:$IMAGE_VERSION | ||
docker tag $IMAGE_NAME $IMAGE_ID:latest | ||
docker push $DEPLOYING_IMAGE_FQDN | ||
|
||
deployment: | ||
needs: docker-image | ||
runs-on: ubuntu-latest | ||
name: "Deploy to k8s cluster" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: azure/[email protected] | ||
|
||
- uses: Azure/k8s-set-context@v2 | ||
with: | ||
method: kubeconfig | ||
kubeconfig: ${{ secrets.KUBE_CONFIG }} | ||
context: solanaaxelartestnetk8s | ||
|
||
- name: Deploy image in k8s | ||
run: kubectl set image deployment/ampd ampd=${{ env.DEPLOYING_IMAGE_FQDN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Ampd binary periodic build | ||
on: | ||
schedule: | ||
# 7 am in the morning. If there are errors due to dependencies, engineers will be notified. | ||
# We are not fixing versions because everything is liquid right now. | ||
- cron: "0 07 * * *" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: "Build the code" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Initially do not cache deps, do a fresh build from zero. | ||
|
||
# - uses: Swatinem/rust-cache@v2 | ||
# with: | ||
# cache-all-crates: true | ||
# cache-on-failure: true | ||
# workspaces: "ampd -> target" | ||
# shared-key: "ampd" | ||
|
||
- name: Build the code | ||
run: cd ampd && cargo build | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This automatically deploy the tofnd dependency in our docker registry: | ||
# https://github.com/axelarnetwork/tofnd | ||
|
||
name: tofnd deployment | ||
on: | ||
schedule: | ||
- cron: "30 22 * * *" | ||
|
||
env: | ||
# If one change any variable of this env block, all of them needs to be aligned, as | ||
# we cannot re-user them. | ||
IMAGE_NAME: tofnd | ||
IMAGE_VERSION: ${{ github.sha }} | ||
IMAGE_ID: solanaaxelartestnetregistry.azurecr.io/solana-axelar/tofnd | ||
DEPLOYING_IMAGE_FQDN: solanaaxelartestnetregistry.azurecr.io/solana-axelar/tofnd:${{ github.sha }} | ||
|
||
jobs: | ||
docker-image: | ||
runs-on: ubuntu-latest | ||
name: "Build and push docker image" | ||
steps: | ||
- name: Checkout repository | ||
run: git clone https://github.com/axelarnetwork/tofnd && cd tofnd | ||
|
||
- name: Build image | ||
run: docker build . --tag $IMAGE_NAME --tag latest | ||
|
||
- name: Login to Azure Container Registry | ||
uses: azure/docker-login@v1 | ||
with: | ||
login-server: ${{ secrets.ACR_REGISTRY_NAME }}.azurecr.io | ||
username: ${{ secrets.AZ_SP_CLIENT_ID }} | ||
password: ${{ secrets.AZ_SP_CLIENT_SECRET }} | ||
|
||
- name: Push image | ||
run: | | ||
docker tag $IMAGE_NAME $IMAGE_ID:$IMAGE_VERSION | ||
docker tag $IMAGE_NAME $IMAGE_ID:latest | ||
docker push $DEPLOYING_IMAGE_FQDN | ||
|
||
deployment: | ||
needs: docker-image | ||
runs-on: ubuntu-latest | ||
name: "Deploy to k8s cluster" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: azure/[email protected] | ||
|
||
- uses: Azure/k8s-set-context@v2 | ||
with: | ||
method: kubeconfig | ||
kubeconfig: ${{ secrets.KUBE_CONFIG }} | ||
context: solanaaxelartestnetk8s | ||
|
||
- name: Deploy image in k8s | ||
run: kubectl set image deployment/ampd tofnd=${{ env.DEPLOYING_IMAGE_FQDN }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed, as we are implementing it in https://github.com/eigerco/solana-axelar-internal/issues/344