Skip to content

Commit

Permalink
Use hugepages in GH workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
afritzler committed Dec 5, 2023
1 parent 4b15398 commit e476b8d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
23 changes: 4 additions & 19 deletions .github/workflows/publish-docker-tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
version: latest
endpoint: ${{ env.CONTEXT_NAME }} # self-hosted
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -80,25 +79,11 @@ jobs:
with:
context: .
platforms: ${{env.platforms}}
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: tester
secrets: |
"github_token=${{ secrets.BOT_PAT }}"
test:
runs-on: [ self-hosted, dpdk ]
needs: buildAndPushTester
steps:
- name: Determine SHA for Docker Image
id: get_sha
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "DOCKER_IMAGE_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "DOCKER_IMAGE_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Run tests
id: run_tests
run: |
docker run --privileged --mount type=bind,source=/dev/hugepages,target=/dev/hugepages ghcr.io/ironcore-dev/dpservice-tester:${{ env.DOCKER_IMAGE_SHA }}
"github_token=${{ secrets.GITHUB_TOKEN }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 0 additions & 2 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,3 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: production
secrets: |
"github_token=${{ secrets.BOT_PAT }}"
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Pull Request Code test

on:
pull_request:
types: [ assigned, opened, synchronize, reopened ]
paths-ignore:
- 'docs/**'
- '**/*.md'

jobs:
checks:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- run: make test
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ COPY .git/ .git/
# therefore downloading using 'ADD' is not possible
RUN --mount=type=secret,id=github_token,dst=/run/secrets/github_token \
sh -c 'GITHUB_TOKEN=$(if [ -f /run/secrets/github_token ]; then cat /run/secrets/github_token; else echo ""; fi) \
&& ./hack/rel_download.sh -dir=exporter -owner=ironcore-dev -repo=prometheus-dpdk-exporter -pat=$GITHUB_TOKEN \
&& ./hack/rel_download.sh -dir=client -owner=ironcore-dev -repo=dpservice-cli -strip=2 -pat=$GITHUB_TOKEN'

# Compile dpservice-bin itself
Expand Down

0 comments on commit e476b8d

Please sign in to comment.