Skip to content

Commit 824a7ab

Browse files
mikekgfbmalfet
authored andcommitted
executable README (#632)
* executable README * fix title of CI workflow * markup commands in markdown * extend the markup-markdown language * improvements * update readme from doc branch * tab/spc * fix errors in updown language * fix errors in updown language, and [skip]: begin/end * fix errors in updown language, and [skip]: begin/end * a storied run * stories run on readme instructions does not need HF token * increase timeout * check for hang un hf_login * skip hf login in case it hangs * skip checkout * don't skip login
1 parent e9def32 commit 824a7ab

File tree

5 files changed

+234
-74
lines changed

5 files changed

+234
-74
lines changed

.github/workflows/run-readme.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Run the README instructions periodically to ensure they work
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Runs daily at midnight UTC
6+
push:
7+
tags:
8+
- ciflow/periodic/*
9+
workflow_dispatch:
10+
11+
jobs:
12+
test-readme:
13+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
14+
secrets: inherit
15+
with:
16+
runner: linux.g5.4xlarge.nvidia.gpu
17+
secrets-env: "HF_TOKEN_PERIODIC"
18+
gpu-arch-type: cuda
19+
gpu-arch-version: "12.1"
20+
script: |
21+
echo "::group::Print machine info"
22+
uname -a
23+
echo "::endgroup::"
24+
25+
# echo "::group::Install newer objcopy that supports --set-section-alignment"
26+
# yum install -y devtoolset-10-binutils
27+
# export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
28+
# echo "::endgroup::"
29+
30+
# echo "::group::get_llama"
31+
# (
32+
# set +x
33+
# HF_TOKEN="${SECRET_HF_TOKEN_PERIODIC}" bash .ci/scripts/download_llama.sh
34+
# )
35+
# echo "::endgroup::"
36+
37+
echo "::group::Create script"
38+
python3 scripts/process-readme.py > ./we-run-this.sh
39+
echo "::endgroup::"
40+
41+
echo "::group::Run This"
42+
bash -x ./we-run-this.sh
43+
44+
echo "tests complete"
45+
echo "******************************************"
46+
echo "::endgroup::"

.github/workflows/run-readme2.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run the README instructions - with stories - to ensure they work
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-readme:
12+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
13+
with:
14+
runner: linux.g5.4xlarge.nvidia.gpu
15+
gpu-arch-type: cuda
16+
gpu-arch-version: "12.1"
17+
timeout: 60
18+
script: |
19+
echo "::group::Print machine info"
20+
uname -a
21+
echo "::endgroup::"
22+
23+
# echo "::group::Install newer objcopy that supports --set-section-alignment"
24+
# yum install -y devtoolset-10-binutils
25+
# export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
26+
# echo "::endgroup::"
27+
28+
echo "::group::Create script"
29+
python3 scripts/process-readme.py > ./readme-commands.sh
30+
echo "::endgroup::"
31+
32+
echo "::group::Run This"
33+
grep -v login ./readme-commands.sh | sed -e '1,$s/llama3/stories15M/g' > ./we-run-this.sh
34+
echo "******************************************"
35+
cat ./we-run-this.sh
36+
echo "******************************************"
37+
bash -x ./we-run-this.sh
38+
39+
echo "tests complete"
40+
echo "******************************************"
41+
echo "::endgroup::"

0 commit comments

Comments
 (0)