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 22 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
100 changes: 80 additions & 20 deletions .github/actions/docker/action.yaml
Original file line number Diff line number Diff line change
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,79 @@ 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 }}

RUN --mount=type=cache,sharing=shared,id=,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 \

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix invalid YAML syntax in RUN command.

These lines appear to be Dockerfile RUN commands mistakenly placed in the YAML file. They should be removed as they are causing syntax errors and don't belong in this workflow file.

Remove these lines as they appear to be accidentally copied from a Dockerfile.

🧰 Tools
🪛 yamllint

[error] 96-96: syntax error: could not find expected ':'

(syntax)

- 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/buildkit-cache-dance@3
with:
name: ${{ inputs.image_name }}
bucket: ${{ inputs.bucket }}
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_index"
},
"../cargo-cache-git-db": {
"target": "/root/.cargo/git/db",
"id": "cargo_registry_index"
},
}
skip-extraction: ${{ steps.cargo-cache.outputs.cache-hit }}

- name: Yarn unplugged cache for Docker
uses: actions/cache@v4
id: yarn-cache
with:
path: ../yarn-unplugged-cache
key: ${{ runner.os }}-yarn-unplugged-amd64-${{ hashFiles('yarn.lock') }}
restore-keys:
- ${{ runner.os }}-yarn-unplugged-amd64-

- name: Inject cargo cache into docker
uses: reproducible-containers/buildkit-cache-dance@3
with:
cache-map: |
{
"../yarn-unplugged-cache": {
"target": "/tmp/unplugged",
"id": "unplugged_amd64"
},
}
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 +168,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 }}
55 changes: 55 additions & 0 deletions .github/actions/librocksdb/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# This action builds and caches librocksdb. If we find that this solution consumes too much time, we can consider
# prebuilding librocksdb outside of the pipeline (eg. in the grovedb release process), publish as an artifact, and
# download it in the pipeline.
name: "librocksdb"
description: "Build and install librocksdb"
inputs:
version:
description: RocksDB version, eg. "8.10.2"
required: false
default: "8.10.2"
bucket:
description: S3 bucket to use for caching
required: false
default: multi-runner-cache-x1xibo9c
force:
description: Force rebuild
required: false
default: "false"

runs:
using: composite
steps:
# Cache librocksdb using s3 bucket
- name: Restore cached librocksdb from S3
id: librocksdb-cache
uses: strophy/actions-cache@opendal-update
with:
bucket: ${{ inputs.bucket }}
path: /opt/rocksdb
key: librocksdb/${{ inputs.version }}/${{ runner.os }}/${{ runner.arch }}

- if: ${{ steps.librocksdb-cache.outputs.cache-hit != 'true' || inputs.force == 'true' }}
shell: bash
name: Build librocksdb
run: |
set -ex
WORKDIR=/tmp/rocksdb-build
mkdir -p ${WORKDIR}/rocksdb
mkdir -p /opt/rocksdb/usr/local/lib/
pushd ${WORKDIR}/rocksdb

# building rocksdb
git clone https://github.com/facebook/rocksdb.git -b v${{ inputs.version }} --depth 1 .
make -j$(nproc) static_lib
make DESTDIR=/opt/rocksdb install-static
set +x

echo Done.
echo Configuration:
echo
echo "ROCKSDB_STATIC='/opt/rocksdb/usr/local/lib/librocksdb.a'"
echo "ROCKSDB_LIB_DIR='/opt/rocksdb/usr/local/lib'"

popd
23 changes: 23 additions & 0 deletions .github/workflows/cached.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Rebuild cached dependencies

on:
workflow_dispatch:
jobs:
build-rust-deps:
name: Prebuild and cache some Rust dependencies
runs-on: ubuntu-24.04
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Precompile librocksdb
uses: ./.github/actions/librocksdb
with:
force: true
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:
name: Deploy docs
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout main
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manage-runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
cancel-merged-or-closed-pr-runs:
name: Cancel runs for merged or closed PRs
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: octokit/request-action@v2.x
id: get_active_workflows
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
pr-title:
name: PR title
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Validate conventional PR title
uses: amannn/action-semantic-pull-request@v5
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/prebuild-devcontainers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- '.github/workflows/prebuild-devcontainers.yml'
- rust-toolchain.toml
- Dockerfile
branches:
- master
workflow_dispatch:

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
publish-manifest:
name: Publish image tags
needs: build-image
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Download digests
uses: actions/download-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ jobs:
matrix:
include:
- package_type: tarballs
os: ubuntu-22.04
os: ubuntu-24.04
- package_type: win
os: ubuntu-22.04
os: ubuntu-24.04
- package_type: deb
os: ubuntu-22.04
os: ubuntu-24.04
- package_type: macos
os: macos-14
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ on:
jobs:
build-image:
name: Build ${{ inputs.name }} image
runs-on: ["self-hosted", "linux", "arm64", "ubuntu-platform"]
# 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 +42,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-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
jobs:
codeql:
name: Run Code QL
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-js-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
lint:
name: Linting
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:

test:
name: Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: read
Expand Down
Loading
Loading