Skip to content

fix: add protection to download createdtask #79

fix: add protection to download createdtask

fix: add protection to download createdtask #79

Workflow file for this run

name: Build and Test
on:
push:
branches-ignore:
- release
tags-ignore: [ '**' ]
jobs:
versionning:
name: Versionning
runs-on: ubuntu-latest
outputs:
version: ${{ steps.genver.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Generate Version
id: genver
uses: codacy/git-version@80c816f11db8dea5e3a81025f598193015b51832 # 2.8.0
with:
minor-identifier: "feat:"
release-branch: release
dev-branch: main
- name: Print version
run: echo VERSION ${{ steps.genver.outputs.version }} >> $GITHUB_STEP_SUMMARY
unitTest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ github.ref }}
submodules: true
- name: Run tests
run: |
cd test/ReRunnerAgentTest/
dotnet test --logger "trx;LogFileName=test-results.trx" -p:RunAnalyzers=false -p:WarningLevel=0
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test - ubuntu test/ReRunnerAgentTest/
path: test/ReRunnerAgentTest/TestResults/test-results.trx
reporter: dotnet-trx
testTaskDumper:
runs-on: ubuntu-latest
needs:
- versionning
strategy:
fail-fast: false
matrix:
scenario:
- ""
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ github.ref }}
- name: Install Dependencies
uses: aneoconsulting/ArmoniK.Action.Deploy/dependencies@main
with:
docker: true
terraform: true
k3s: true
aws: true
- name: Checkout Infra
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
repository: aneoconsulting/ArmoniK
path: infra
- id: deploy
name: Deploy
uses: aneoconsulting/ArmoniK.Action.Deploy/deploy@main
with:
working-directory: ${{ github.workspace }}/infra
type: localhost
ext-csharp-version: 0.18.0
core-version: 0.25.0
- name: Run HtcMock Client
run: |
export CPIP=$(kubectl get svc control-plane -n armonik -o custom-columns="IP:.spec.clusterIP" --no-headers=true)
export CPPort=$(kubectl get svc control-plane -n armonik -o custom-columns="PORT:.spec.ports[*].port" --no-headers=true)
export Grpc__Endpoint=http://$CPIP:$CPPort
echo "CPPort=$CPPort" >> $GITHUB_ENV
echo "CPIP=$CPIP" >> $GITHUB_ENV
echo "Grpc__Endpoint=$Grpc__Endpoint" >> $GITHUB_ENV
docker run --rm -e HtcMock__NTasks=100 -e HtcMock__TotalCalculationTime=00:00:00.100 -e HtcMock__DataSize=1 -e HtcMock__MemorySize=1 -e HtcMock__PurgeData=false -e HtcMock__EnableFastCompute=true -e HtcMock__SubTasksLevels=4 -e HtcMock__Partition=htcmock -e HtcMock__TaskError="6" -e GrpcClient__Endpoint=$Grpc__Endpoint dockerhubaneo/armonik_core_htcmock_test_client:$(jq -r ".armonik_versions.core" infra/versions.tfvars.json) || true
- name: Retrieve TaskID
run: |
sudo apt install python3-venv
git clone https://github.com/aneoconsulting/ArmoniK.Admin.CLI.git
cd ArmoniK.Admin.CLI
python -m venv ./venv
source ./venv/bin/activate
pip install build
python -m build
pip install dist/*.whl
export SESSIONID=$(armonik_admin_cli --endpoint ${{ env.CPIP }}:${{ env.CPPort }} list-session --all | sed -n 's/Session ID: //p')
export TASKID=$(armonik_admin_cli --endpoint ${{ env.CPIP }}:${{ env.CPPort }} list-task $SESSIONID --error | head -n 1 | awk '{print $3}')
echo "taskId=$TASKID" >> $GITHUB_ENV
- name: Run TaskDumper
working-directory: src/TaskDumper
run: |
dotnet run --endpoint ${{ env.Grpc__Endpoint }} --taskId ${{ env.taskId }} --dataFolder /tmp/test
- name: Run Worker HtcMock
working-directory: src/TaskReRunner
run: |
mkdir /tmp/sockets
chmod 777 /tmp/sockets
docker run --rm -d --name htcmock -u $(id -u) -e ComputePlane__WorkerChannel__Address=/cache/worker.sock -e ComputePlane__AgentChannel__Address=/cache/agent.sock -v /tmp/sockets:/cache -v /tmp/test:/tmp/test -v ${{ github.workspace }}:${{ github.workspace }} dockerhubaneo/armonik_core_htcmock_test_worker:0.25.0
- name: Run TaskReRunner
working-directory: src/TaskReRunner
run: |
dotnet run --path /tmp/test/Task.json
publish-nuget:
strategy:
matrix:
projects:
- src/TaskReRunner/ArmoniK.TaskReRunner.csproj
- src/TaskDumper/ArmoniK.TaskDumper.csproj
fail-fast: false
runs-on: ubuntu-latest
needs:
- versionning
env:
VERSION: ${{ needs.versionning.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
ref: ${{ github.ref }}
- name: Build the package
run: |
dotnet build ${{ matrix.projects }} -c Release -p:RunAnalyzers=false -p:WarningLevel=0
- name: Pack the package
run: |
dotnet pack ${{ matrix.projects }} -c Release -o /tmp/packages -p:PackageVersion=$VERSION -p:Version=$VERSION
- name: Push the package
run: dotnet nuget push /tmp/packages/ArmoniK.*.nupkg -k ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json