-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (76 loc) · 2.42 KB
/
estimate-memory.yml
File metadata and controls
84 lines (76 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Estimate Memory
on:
workflow_dispatch:
inputs:
repo_url:
description: 'GitHub repository URL of the operator to test'
required: true
type: string
team_name:
description: 'Team name for project and workflow ownership'
required: true
type: string
n_obs:
description: 'Number of observations (default: 500)'
required: false
type: string
default: '500:2:700'
n_sp:
description: 'Number of species (default: 4)'
required: false
type: string
default: '2:2:10'
n_variable:
description: 'Number of variables (default: 4)'
required: false
type: string
default: '2:2:10'
jobs:
estimate-memory:
runs-on: ubuntu-latest
outputs:
memory-estimate: ${{ steps.save-output.outputs.result }}
steps:
- name: Start tercen server
uses: tercen/actions/start-tercen@main
- name: Log in to the Container registry
uses: docker/login-action@v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run memory estimator
id: run-estimator
run: |
docker run --rm \
${{ env.REGISTRY }}/tercen/memory_estimator:main \
--repo-url ${{ inputs.repo_url }} \
--team-name ${{ inputs.team_name }} \
--tercen-url http://127.0.0.1:5400 \
--tercen-token ${{ secrets.TERCEN_TOKEN }} \
--n-obs ${{ inputs.n_obs }} \
--n-sp ${{ inputs.n_sp }} \
--n-variable ${{ inputs.n_variable }} \
> memory-estimate.json
- name: Save output
id: save-output
run: |
echo "result=$(cat memory-estimate.json | jq -c .)" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: memory-estimate
path: memory-estimate.json
use-memory-estimate:
runs-on: ubuntu-latest
needs: estimate-memory
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: memory-estimate
- name: Display memory estimate
run: |
echo "Memory estimate from previous job:"
cat memory-estimate.json
echo "From output: ${{ needs.estimate-memory.outputs.memory-estimate }}"