Skip to content

Commit

Permalink
infra: setup tzwitter pipelines and compiled kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilevos committed Jun 5, 2023
1 parent 834c132 commit 55c5bab
Show file tree
Hide file tree
Showing 149 changed files with 563 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.DS_Store
34 changes: 34 additions & 0 deletions .github/workflows/baseimage_build_kernels-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Common - docker baseimage to build kernels

on:
workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: ./infra_tooling/docker/baseimage_build_kernels/
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.ref == 'refs/heads/main' }}
tags: |
ghcr.io/marigold-dev/baseimage-build-kernels:latest
ghcr.io/marigold-dev/baseimage-build-kernels:${{ github.sha }}
46 changes: 46 additions & 0 deletions .github/workflows/dungeon-frontend-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Dungeon - frontend docker

on:
push:
branches:
- "dungeon-game"
paths:
- "10_dungeon/app/**"
workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Replace sequencer endpoint
id: sed
run: |
set -x
sed -i 's|http://127.0.0.1:8080|https://dungeon-sequencer-test1.gcp.marigold.dev|g' 10_dungeon/app/src/App.js
cat 10_dungeon/app/src/App.js
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: ./10_dungeon/app/
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.ref == 'refs/heads/dungeon-game' }}
tags: |
ghcr.io/marigold-dev/dungeon-frontend:latest
ghcr.io/marigold-dev/dungeon-frontend:${{ github.sha }}
83 changes: 83 additions & 0 deletions .github/workflows/dungeon-initcontainer-import-kernel-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Dungeon - docker initcontainer-import-kernel

on:
push:
branches:
- "dungeon-game"
paths:
- "./infra_tooling/build_artifacts/10_dungeon/.latest"
workflow_dispatch:
inputs:
rollup_data_dir_name:
description: 'Name of the dungeon compiled kernel directory to deploy on K8S (eg, dungeon-6e60112)'
required: true

env:
ARTEFACTS_PROJECT_PATH: ./infra_tooling/build_artifacts/10_dungeon
IMG_SUFFIX: dungeon
PROJECT_NAME: 10_dungeon

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set image tag vars
id: tag_vars
run: |
echo "date=$(date +%Y-%m-%dT%H-%M-%S)" >> "${GITHUB_OUTPUT}"
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
- name: Set rollup_data_dir_name
id: vars_pt1
run: |
if [[ -z "${{ github.event.inputs.rollup_data_dir_name }}" ]]; then
echo "rollup_data_dir_name=$(cat ${{ env.ARTEFACTS_PROJECT_PATH }}/.latest)" >> "${GITHUB_OUTPUT}"
else
echo "rollup_data_dir_name=${{ github.event.inputs.rollup_data_dir_name }}" >> "${GITHUB_OUTPUT}"
fi
- name: Set rollup_data_dir_fullpath
id: vars_pt2
run: |
echo "rollup_data_dir_fullpath=${{ env.ARTEFACTS_PROJECT_PATH }}/${{ steps.vars_pt1.outputs.rollup_data_dir_name }}" >> "${GITHUB_OUTPUT}"
- name: Check rollup_data_dir_fullpath
id: check_rollup_data_dir_fullpath
run: |
echo "rollup_data_dir_fullpath=${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }}"
if [ ! -d "${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }}" ]; then
echo "Directory ${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }} does not exist. Exiting..."
exit 1
fi
- name: Copy Dockerfile and scripts
id: copy
run: |
cp -r ./infra_tooling/docker/initcontainer_import_kernel/* ${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: ${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.ref == 'refs/heads/dungeon-game' }}
tags: |
ghcr.io/marigold-dev/dungeon-initcontainer-import:${{ steps.vars_pt1.outputs.rollup_data_dir_name }}
ghcr.io/marigold-dev/dungeon-initcontainer-import:latest
ghcr.io/marigold-dev/dungeon-initcontainer-import:${{ steps.tag_vars.outputs.date }}-${{ steps.tag_vars.outputs.sha_short }}
52 changes: 52 additions & 0 deletions .github/workflows/dungeon-sequencer-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Dungeon - sequencer docker

on:
push:
branches:
- "dungeon-game"
paths:
- "10_dungeon/sequencer/**"
workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set image tag vars
id: tag_vars
run: |
echo "date=$(date +%Y-%m-%dT%H-%M-%S)" >> "${GITHUB_OUTPUT}"
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
- name: Checkout
uses: actions/checkout@v3

- name: Copy Dockerfile and scripts
id: copy
run: |
cp -r ./infra_tooling/docker/dungeon-sequencer-build/* 10_dungeon
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
file: ./10_dungeon/Dockerfile.sequencer
context: ./10_dungeon/
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.ref == 'refs/heads/dungeon-game' }}
tags: |
ghcr.io/marigold-dev/dungeon-sequencer:latest
ghcr.io/marigold-dev/dungeon-sequencer:${{ github.sha }}
ghcr.io/marigold-dev/dungeon-sequencer:${{ steps.tag_vars.outputs.date }}-${{ steps.tag_vars.outputs.sha_short }}
51 changes: 51 additions & 0 deletions .github/workflows/tzwitter-frontend-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tzwitter - frontend docker

on:
push:
branches:
- "main"
paths:
- "09_tzwitter_app/app/**"
workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Sed on config.ts # (yep thats bad)
run: |
set -x
sed -i '/TEZOS_RPC/d' 09_tzwitter_app/app/src/config.ts
sed -i '/ROLLUP_RPC/d' 09_tzwitter_app/app/src/config.ts
echo "export const TEZOS_RPC = 'https://ghostnet.tezos.marigold.dev';" >> 09_tzwitter_app/app/src/config.ts
echo "export const ROLLUP_RPC = 'https://tzwitter-rollup-test1.gcp.marigold.dev';" >> 09_tzwitter_app/app/src/config.ts
cat 09_tzwitter_app/app/src/config.ts
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: ./09_tzwitter_app/app/
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.ref == 'refs/heads/main' }}
tags: |
ghcr.io/marigold-dev/tzwitter-frontend:latest
ghcr.io/marigold-dev/tzwitter-frontend:${{ github.sha }}
build-args: |
TEZOS_RPC=${{ env.TEZOS_RPC }}
ROLLUP_RPC=${{ env.ROLLUP_RPC }}
83 changes: 83 additions & 0 deletions .github/workflows/tzwitter-initcontainer-import-kernel-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Tzwitter - docker initcontainer-import-kernel

on:
push:
branches:
- "main"
paths:
- "./infra_tooling/build_artifacts/09_tzwitter_app/.latest"
workflow_dispatch:
inputs:
rollup_data_dir_name:
description: 'Name of the tzwitter compiled kernel directory to deploy on K8S (eg, tzwitter-834c132-tz1e9eADqkLKnR9h77sAVtZwjRifSJbukFxZ)'
required: true

env:
ARTEFACTS_PROJECT_PATH: ./infra_tooling/build_artifacts/09_tzwitter_app
IMG_SUFFIX: tzwitter
PROJECT_NAME: 09_tzwitter_app

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set image tag vars
id: tag_vars
run: |
echo "date=$(date +%Y-%m-%dT%H-%M-%S)" >> "${GITHUB_OUTPUT}"
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
- name: Set rollup_data_dir_name
id: vars_pt1
run: |
if [[ -z "${{ github.event.inputs.rollup_data_dir_name }}" ]]; then
echo "rollup_data_dir_name=$(cat ${{ env.ARTEFACTS_PROJECT_PATH }}/.latest)" >> "${GITHUB_OUTPUT}"
else
echo "rollup_data_dir_name=${{ github.event.inputs.rollup_data_dir_name }}" >> "${GITHUB_OUTPUT}"
fi
- name: Set rollup_data_dir_fullpath
id: vars_pt2
run: |
echo "rollup_data_dir_fullpath=${{ env.ARTEFACTS_PROJECT_PATH }}/${{ steps.vars_pt1.outputs.rollup_data_dir_name }}" >> "${GITHUB_OUTPUT}"
- name: Check rollup_data_dir_fullpath
id: check_rollup_data_dir_fullpath
run: |
echo "rollup_data_dir_fullpath=${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }}"
if [ ! -d "${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }}" ]; then
echo "Directory ${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }} does not exist. Exiting..."
exit 1
fi
- name: Copy Dockerfile and scripts
id: copy
run: |
cp -r ./infra_tooling/docker/initcontainer_import_kernel/* ${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: ${{ steps.vars_pt2.outputs.rollup_data_dir_fullpath }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.ref == 'refs/heads/main' }}
tags: |
ghcr.io/marigold-dev/tzwitter-initcontainer-import:${{ steps.vars_pt1.outputs.rollup_data_dir_name }}
ghcr.io/marigold-dev/tzwitter-initcontainer-import:latest
ghcr.io/marigold-dev/tzwitter-initcontainer-import:${{ steps.tag_vars.outputs.date }}-${{ steps.tag_vars.outputs.sha_short }}
1 change: 1 addition & 0 deletions infra_tooling/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/.DS_Store
1 change: 1 addition & 0 deletions infra_tooling/build_artifacts/09_tzwitter_app/.latest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tzwitter-55f9aa9-tz1e9eADqkLKnR9h77sAVtZwjRifSJbukFxZ
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
KT1LFWurbZWRwGMUEZugS8kWU3NaUbWzcQ38
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tz1e9eADqkLKnR9h77sAVtZwjRifSJbukFxZ
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tzwitter

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
KT1Wz65fGeCGcyDhb3vEzmDWhpaEokWzHUZ6
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tz1e9eADqkLKnR9h77sAVtZwjRifSJbukFxZ
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tzwitter
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ "smart-rollup-address": "sr1CZJvoP5VRnwacrB6BF13HfQ4dJKFhPiq7",
"smart-rollup-node-operator":
{ "publish": "tz1XeW5BaTm8h4Nkp6RPWWcUEjxnVUkiKr2x",
"add_messages": "tz1XeW5BaTm8h4Nkp6RPWWcUEjxnVUkiKr2x",
"cement": "tz1XeW5BaTm8h4Nkp6RPWWcUEjxnVUkiKr2x",
"refute": "tz1XeW5BaTm8h4Nkp6RPWWcUEjxnVUkiKr2x" },
"fee-parameters": {}, "mode": "operator" }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10388
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10388
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10388
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10388
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10388
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 55c5bab

Please sign in to comment.