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

ci: switch to free runners #2319

Merged
merged 46 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
24177fa
feat: hardcoded identity transfers in strategy tests
pauldelucia Nov 4, 2024
dacc6db
fix(drive): uncommitted state if db transaction fails (#2305)
shumkov Nov 4, 2024
306b86c
fix(drive): apply batch is not using transaction in `remove_all_votes…
QuantumExplorer Nov 4, 2024
99fe5fa
add comment
pauldelucia Nov 4, 2024
cee3098
Merge remote-tracking branch 'origin/v1.6-dev' into feat/hardcoded-id…
pauldelucia Nov 4, 2024
0d3e091
comment
pauldelucia Nov 5, 2024
e421514
use into_iter instead of iter
pauldelucia Nov 5, 2024
3d941ec
use current identities instead of hardcoded start identities
pauldelucia Nov 5, 2024
4bc0a65
let transfer keys be any security level or key type
pauldelucia Nov 5, 2024
dc48827
fix
pauldelucia Nov 5, 2024
cafda11
feat: hardcoded identity transfers in strategy tests (#2312)
pauldelucia Nov 5, 2024
b86f4e0
Merge branch 'v1.6-dev' of github.com:dashpay/platform into v1.6-dev
shumkov Nov 6, 2024
ae97f47
ci: run devcontainers workflow only on push to master (#2295)
shumkov Nov 6, 2024
48cca1a
ci: do not run test on push (#2308)
shumkov Nov 6, 2024
5c80069
ci: use prebuilt librocksdb in github actions (#2316)
lklimek Nov 8, 2024
2b9d715
ci: debug layer cache
shumkov Nov 8, 2024
42fdd64
ci: update docker/build-push-action@
shumkov Nov 8, 2024
fe231e2
ci: try gha cache
shumkov Nov 8, 2024
626a632
ci: pass push
shumkov Nov 8, 2024
5a9d214
ci: disable mount cache
shumkov Nov 8, 2024
a333049
build: uncomment code in Dockerfile
shumkov Nov 8, 2024
39e9d43
ci: store cargo and yarn cache mounts
shumkov Nov 8, 2024
d6cbbc2
ci: remove garbage
shumkov Nov 8, 2024
e31d501
ci: fix restore keys
shumkov Nov 8, 2024
63c3d50
ci: specify correct version
shumkov Nov 8, 2024
9ca6ffd
ci: fix expected JSON
shumkov Nov 8, 2024
698a8a8
build: remove random port
shumkov Nov 8, 2024
ba2e477
ci: switch build js to free runner
shumkov Nov 8, 2024
7531fc9
ci: cleanup
shumkov Nov 8, 2024
25c31a6
ci: use platform input for unplugged cache
shumkov Nov 11, 2024
01e09b6
ci: switch to free runners
shumkov Nov 11, 2024
20eed8a
ci: switch more jobs to free runners
shumkov Nov 11, 2024
3036336
Merge branch 'v1.6-dev' into ci/docker-layer-cache
shumkov Nov 11, 2024
3a8b9a1
build: fix sccache error
shumkov Nov 13, 2024
b5e9ea0
ci: remove prefix
shumkov Nov 13, 2024
9855b2a
ci: second try to remove prefix
shumkov Nov 13, 2024
3d70254
ci: fix dashmate path
shumkov Nov 13, 2024
33ad11b
ci: fix sed
shumkov Nov 13, 2024
fa5a188
ci: fix HOME var
shumkov Nov 13, 2024
633e2ab
refactor: remove unused params
shumkov Nov 13, 2024
bd18a7e
ci: remove CHROME_BIN
shumkov Nov 13, 2024
ad83ebb
revert: unnecessary changes
shumkov Nov 13, 2024
738d1a5
Merge branch 'v1.6-dev' into ci/docker-layer-cache
shumkov Nov 13, 2024
a8bd8ff
revert: mount cache
shumkov Nov 13, 2024
df8eb06
Merge remote-tracking branch 'origin/ci/docker-layer-cache' into ci/d…
shumkov Nov 13, 2024
ca7017a
ci: fix home dir
shumkov Nov 13, 2024
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
115 changes: 89 additions & 26 deletions .github/actions/docker/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ inputs:
description: User name to use when pushing images to Docker Hub
dockerhub_token:
description: Docker Hub token to use
cache_mounts:
description: Load cache mounts cache
default: |
cargo_registry_index
cargo_registry_cache
cargo_git
# cache_mounts:
# description: Load cache mounts cache
# default: |
# cargo_registry_index
# cargo_registry_cache
# cargo_git
cargo_profile:
description: Cargo build profile, i.e release or dev
default: dev
Expand Down Expand Up @@ -69,12 +69,12 @@ runs:
[worker.oci]
gc = false

- name: Load Docker mount cache
uses: dcginfra/buildkit-cache-dance/inject@s5cmd
if: ${{ inputs.cache_mounts != '' }}
with:
bucket: ${{ inputs.bucket }}
mounts: ${{ inputs.cache_mounts }}
# - name: Load Docker mount cache
# uses: dcginfra/buildkit-cache-dance/inject@s5cmd
# if: ${{ inputs.cache_mounts != '' }}
# with:
# bucket: ${{ inputs.bucket }}
# mounts: ${{ inputs.cache_mounts }}

- name: Set Docker tags and labels from image tag
id: docker_meta
Expand All @@ -85,21 +85,82 @@ runs:
type=semver,pattern={{version}},value=${{inputs.image_version}},enable=${{ inputs.image_version != '' }}
type=sha,format=long,enable=${{ inputs.image_version == '' }}

- name: Configure docker layer cache
uses: ./.github/actions/s3-layer-cache-settings
id: layer_cache_settings
# - name: Configure docker layer cache
# uses: ./.github/actions/s3-layer-cache-settings
# id: layer_cache_settings
# with:
# name: ${{ inputs.image_name }}
# bucket: ${{ inputs.bucket }}

- name: Cargo cache for Docker
uses: actions/cache@v4
id: cargo-cache
with:
path: |
../cargo-cache-registry-index
../cargo-cache-registry-cache
../cargo-cache-git-db
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: |
- ${{ runner.os }}-cargo-

- name: Inject cargo cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"../cargo-cache-registry-index": {
"target": "/root/.cargo/registry/index",
"id": "cargo_registry_index"
},
"../cargo-cache-registry-cache": {
"target": "/root/.cargo/registry/cache",
"id": "cargo_registry_cache"
},
"../cargo-cache-git-db": {
"target": "/root/.cargo/git/db",
"id": "cargo_git"
}
}
skip-extraction: ${{ steps.cargo-cache.outputs.cache-hit }}

- name: Yarn unplugged cache for Docker
uses: actions/cache@v4
id: yarn-cache
with:
name: ${{ inputs.image_name }}
bucket: ${{ inputs.bucket }}
path: ../yarn-unplugged-cache
key: ${{ inputs.platform }}-yarn-unplugged-${{ hashFiles('yarn.lock') }}
restore-keys: |
- ${{ inputs.platform }}-yarn-unplugged-

- name: Set arch
id: arch
uses: actions/github-script@v6
with:
result-encoding: 'string'
script: return '${{ inputs.platform }}'.replace('linux/', '');

- name: Inject cargo cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: |
{
"../yarn-unplugged-cache": {
"target": "/tmp/unplugged",
"id": "unplugged_${{ steps.arch.outputs.result }}"
}
}
skip-extraction: ${{ steps.yarn-cache.outputs.cache-hit }}

- name: Build and push Docker image ${{ inputs.image }}
id: docker_build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
target: ${{ inputs.target }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ inputs.push_tags }}
tags: ${{ inputs.push_tags == 'true' && steps.docker_meta.outputs.tags || '' }}
platforms: ${{ inputs.platform }}
build-args: |
Expand All @@ -110,13 +171,15 @@ runs:
SCCACHE_S3_KEY_PREFIX=${{ runner.os }}/sccache
AWS_ACCESS_KEY_ID=${{ inputs.aws_access_key_id }}
AWS_SECRET_ACCESS_KEY=${{ inputs.aws_secret_access_key }}
cache-from: ${{ steps.layer_cache_settings.outputs.cache_from }}
cache-to: ${{ steps.layer_cache_settings.outputs.cache_to }}
#cache-from: ${{ steps.layer_cache_settings.outputs.cache_from }}
cache-from: type=gha
#cache-to: ${{ steps.layer_cache_settings.outputs.cache_to }}
cache-to: type=gha,mode=max
outputs: type=image,name=${{ inputs.image_org }}/${{ inputs.image_name }},push-by-digest=${{ inputs.push_tags != 'true' }},name-canonical=true,push=true

- name: Save Docker mount cache
uses: dcginfra/buildkit-cache-dance/extract@s5cmd
if: ${{ inputs.cache_mounts != '' }}
with:
bucket: ${{ inputs.bucket }}
mounts: ${{ inputs.cache_mounts }}
# - name: Save Docker mount cache
# uses: dcginfra/buildkit-cache-dance/extract@s5cmd
# if: ${{ inputs.cache_mounts != '' }}
# with:
# bucket: ${{ inputs.bucket }}
# mounts: ${{ inputs.cache_mounts }}
6 changes: 3 additions & 3 deletions .github/actions/local-network/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ runs:
bucket: multi-runner-cache-x1xibo9c
root: local-network-data
path: |
/home/ubuntu/.dashmate
${{ env.HOME }}/.dashmate
**/.env
dashmate_volumes_dump
key: local-network-volumes/${{ steps.dashmate-fingerprint.outputs.sha }}
Expand Down Expand Up @@ -73,7 +73,7 @@ runs:
bucket: multi-runner-cache-x1xibo9c
root: local-network-data
path: |
/home/ubuntu/.dashmate
${{ env.HOME }}/.dashmate
**/.env
dashmate_volumes_dump
key: local-network-volumes/${{ steps.dashmate-fingerprint.outputs.sha }}
Expand All @@ -92,7 +92,7 @@ runs:
# Replace DAPI and Drive images with new org and tag in dashmate config
sed -i -E "s/dashpay\/(drive|dapi):[^\"]+/${{ inputs.image_org }}\/\1:${SHA_TAG}/g" /home/ubuntu/.dashmate/config.json

cat /home/ubuntu/.dashmate/config.json
cat ${{ env.HOME }}/.dashmate/config.json
shumkov marked this conversation as resolved.
Show resolved Hide resolved

- name: Start local network
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prebuild-devcontainers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:
jobs:
build:
name: Build and push devcontainer
runs-on: ["self-hosted", "linux", "x64", "ubuntu-platform"]
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ concurrency:
jobs:
release-npm:
name: Release NPM packages
runs-on: ["self-hosted", "linux", "arm64", "ubuntu-platform"]
runs-on: ubuntu-24.04
timeout-minutes: 15
if: github.event_name != 'workflow_dispatch'
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
build-image:
name: Build ${{ inputs.name }} image
runs-on: ["self-hosted", "linux", "arm64", "ubuntu-platform"]
runs-on: ubuntu-24.04
steps:
- name: Check out repo
uses: actions/checkout@v4
Expand All @@ -41,7 +41,7 @@ jobs:
image_name: ${{ inputs.image_name }}
image_org: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com
target: ${{ inputs.target }}
platform: linux/arm64
platform: linux/amd64
push_tags: true
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-build-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
jobs:
build-js:
name: Build JS
runs-on: ["self-hosted", "linux", "arm64", "ubuntu-platform"]
runs-on: ubuntu-24.04
steps:
- name: Configure AWS credentials and bucket region
uses: aws-actions/configure-aws-credentials@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-dashmate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ on:
jobs:
dashmate-test:
name: Run ${{ inputs.name }} tests
# TODO: Try with Github Runner, probably it will be the same time
runs-on: [ "self-hosted", "linux", "arm64", "ubuntu-platform" ]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out repo
Expand All @@ -42,6 +41,7 @@ jobs:
- name: Setup Node.JS
uses: ./.github/actions/nodejs

# TODO: Use action artifacts
- name: Restore JS build artifacts
uses: strophy/actions-cache@opendal-update
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-packges-functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
jobs:
test-functional:
name: Run functional tests
runs-on: [ "self-hosted", "linux", "arm64", "ubuntu-platform" ]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
CHROME_BIN: /usr/bin/brave-browser
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
jobs:
test-suite:
name: Run ${{ inputs.name }}
runs-on: [ "self-hosted", "linux", "arm64", "ubuntu-platform" ]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
CHROME_BIN: /usr/bin/brave-browser
Expand Down
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# 2. We add `--config net.git-fetch-with-cli=true` to address ARM build issue,
# see https://github.com/rust-lang/cargo/issues/10781#issuecomment-1441071052
# 3. Github Actions have shared networking configured, so we need to set a random
# SCCACHE_SERVER_PORT port to avoid conflicts in case of parallel compilation

ARG ALPINE_VERSION=3.18
ARG PROTOC_VERSION=27.3
Expand Down Expand Up @@ -118,7 +117,7 @@ ARG RUSTC_WRAPPER
ENV RUSTC_WRAPPER=${RUSTC_WRAPPER}

# Set args below to use Github Actions cache; see https://github.com/mozilla/sccache/blob/main/docs/GHA.md
ARG SCCACHE_GHA_ENABLED
ARG SCCACHE_GHA_ENABLED="false"
ENV SCCACHE_GHA_ENABLED=${SCCACHE_GHA_ENABLED}

ARG ACTIONS_CACHE_URL
Expand Down Expand Up @@ -156,13 +155,13 @@ ENV SCCACHE_S3_KEY_PREFIX=${SCCACHE_S3_KEY_PREFIX}/${TARGETARCH}/linux-musl

WORKDIR /platform

# TODO: Use https://github.com/cargo-bins/cargo-binstall
# Install wasm-bindgen-cli in the same profile as other components, to sacrifice some performance & disk space to gain
# better build caching
RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOME}/registry/index \
--mount=type=cache,sharing=shared,id=cargo_registry_cache,target=${CARGO_HOME}/registry/cache \
--mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \
--mount=type=cache,sharing=shared,id=target_${TARGETARCH},target=/platform/target \
export SCCACHE_SERVER_PORT=$((RANDOM+1025)) && \
source $HOME/.cargo/env && \
if [[ -z "${SCCACHE_MEMCACHED}" ]] ; then unset SCCACHE_MEMCACHED ; fi ; \
RUSTFLAGS="-C target-feature=-crt-static" \
Expand Down Expand Up @@ -206,7 +205,6 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM
--mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \
--mount=type=cache,sharing=shared,id=target_${TARGETARCH},target=/platform/target \
source $HOME/.cargo/env && \
export SCCACHE_SERVER_PORT=$((RANDOM+1025)) && \
if [[ -z "${SCCACHE_MEMCACHED}" ]] ; then unset SCCACHE_MEMCACHED ; fi ; \
cargo chef cook \
--recipe-path recipe.json \
Expand All @@ -225,14 +223,12 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM
--mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \
--mount=type=cache,sharing=shared,id=target_${TARGETARCH},target=/platform/target \
source $HOME/.cargo/env && \
export SCCACHE_SERVER_PORT=$((RANDOM+1025)) && \
if [[ "${CARGO_BUILD_PROFILE}" == "release" ]] ; then \
mv .cargo/config-release.toml .cargo/config.toml && \
export OUT_DIRECTORY=release ; \
else \
export FEATURES_FLAG="--features=console,grovedbg" ; \
export OUT_DIRECTORY=debug ; \

fi && \
if [[ -z "${SCCACHE_MEMCACHED}" ]] ; then unset SCCACHE_MEMCACHED ; fi ; \
cargo build \
Expand Down Expand Up @@ -261,7 +257,6 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM
--mount=type=cache,sharing=shared,id=cargo_git,target=${CARGO_HOME}/git/db \
--mount=type=cache,sharing=shared,id=target_${TARGETARCH},target=/platform/target \
source $HOME/.cargo/env && \
export SCCACHE_SERVER_PORT=$((RANDOM+1025)) && \
if [[ -z "${SCCACHE_MEMCACHED}" ]] ; then unset SCCACHE_MEMCACHED ; fi ; \
cargo chef cook \
--recipe-path recipe.json \
Expand All @@ -282,7 +277,6 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM
cp -R /tmp/unplugged /platform/.yarn/ && \
yarn install --inline-builds && \
cp -R /platform/.yarn/unplugged /tmp/ && \
export SCCACHE_SERVER_PORT=$((RANDOM+1025)) && \
if [[ -z "${SCCACHE_MEMCACHED}" ]] ; then unset SCCACHE_MEMCACHED ; fi ; \
export SKIP_GRPC_PROTO_BUILD=1 && \
yarn build && \
Expand Down
Loading