-
Notifications
You must be signed in to change notification settings - Fork 828
110 lines (94 loc) · 3.11 KB
/
run-tokenizer-tests.yml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: "[ARC][CPU] Run Tokenizer Tests"
on:
# TODO: Add later when all tests are accounted for.
#
#pull_request:
# branches:
# - 'main'
# paths:
# - 'models/llama3/api/*.py'
#
push:
branches:
- "ci_cd_testing"
workflow_dispatch:
inputs:
runner:
description: 'GHA Runner Scale Set label to run workflow on.'
required: true
default: llama-models-gha-runnes-gpu
debug:
description: 'Run debugging steps?'
required: false
default: "true"
sleep_time:
description: '[DEBUG] sleep time for debugging'
required: true
default: "60"
branch:
description: "Branch parameter to control which branch to checkout"
required: true
default: "main"
env:
TOKENIZER_PATH: "models/llama3/api/tokenizer.py"
jobs:
execute_workflow:
name: Execute workload on Self-Hosted CPU k8s runner
defaults:
run:
shell: bash # default shell to run all steps for a given job.
runs-on: ${{ github.event.inputs.runner != '' && github.event.inputs.runner || 'llama-models-gha-runnes-gpu' }}
steps:
- name: "[DEBUG] Get runner container OS information"
id: os_info
if: ${{ github.event.inputs.debug == 'true' }}
run: |
cat /etc/os-release
- name: "Checkout 'meta-llama/llama-models' repository"
id: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: "[DEBUG] Content of the repository after checkout"
id: content_after_checkout
if: ${{ github.event.inputs.debug == 'true' }}
run: |
ls -la ${GITHUB_WORKSPACE}
# - name: "Forced sleep_600"
# id: forced_sleep_600
# run: |
# sleep 600
# Place sleep step before the test execution to "exec" into the test k8s POD and run tests manually to identify what dependencies are being used.
- name: "[DEBUG] sleep"
id: sleep
if: ${{ github.event.inputs.debug == 'true' && github.event.inputs.sleep_time != '' }}
run: |
sleep ${{ inputs.sleep_time }}
- name: "Installing 'apt' required packages"
id: apt_install
run: |
sudo apt update -y
sudo apt upgrade -y
sudo apt install python3-pip -y
- name: "Installing 'llama-models' dependencies"
id: pip_install
run: |
echo "[STEP] Installing 'llama-models' models"
pip install -U pip setuptools
pip install -r requirements.txt
pip install blobfile
- name: Set environment variable
id: set_env
run: |
echo "TOKENIZER_PATH=models/llama3/api/tokenizer.py" >> $GITHUB_ENV
- name: Run tests
id: run_tests
run: |
echo "Running tests on Self-Hosted k8s ARC Runner"
cd $GITHUB_WORKSPACE && python3 -m unittest models/llama3/api/test_tokenizer.py
- name: Publish Test Summary
id: test_summary
uses: test-summary/action@v2
with:
paths: "**/*.xml"
if: always()