• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2
3set -e -u
4
5# first import docker image
6if [ -f ./manywheel-s390x.tar ] ; then
7        docker image load --input manywheel-s390x.tar
8        docker image tag docker.io/pytorch/manylinuxs390x-builder:cpu-s390x docker.io/pytorch/manylinuxs390x-builder:cpu-s390x-main
9        rm -f manywheel-s390x.tar
10fi
11
12token_file=registration-token.json
13
14# Generate registration token
15curl \
16        -X POST \
17        -H "Accept: application/vnd.github.v3+json" \
18        -H "Authorization: Bearer ${ACCESS_TOKEN}" \
19        "https://api.github.com/orgs/${ORG}/actions/runners/registration-token" \
20        -o "$token_file"
21
22unset ACCESS_TOKEN
23
24# register runner as ephemeral runner
25# it does one job, stops and unregisters
26registration_token=$(jq --raw-output .token "$token_file")
27
28./config.sh \
29        --unattended \
30        --ephemeral \
31        --url "https://github.com/${ORG}" \
32        --token "${registration_token}" \
33        --name "${NAME}" \
34        --no-default-labels \
35        --labels self-hosted,linux.s390x
36
37unset registration_token
38rm -f "$token_file"
39
40# enter into python virtual environment.
41# build workflows use "python -m pip install ...",
42# and it doesn't work for non-root user
43source venv/bin/activate
44
45# Run one job.
46./run.sh
47