aboutsummaryrefslogtreecommitdiff
path: root/ldcg-python-manylinux-tensorflow/publishers.sh
blob: ae19b34add017b25f0d6b7762cb5a9537ed82b82 (plain)
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
#!/bin/bash

# First publish wheels to cache

COPY_FROM=${WORKSPACE}/cache_upload/
PUBLISH_TO=ldcg/python-cache/

set -ex

# Publish wheel files
test -d ${HOME}/bin || mkdir ${HOME}/bin
wget -q https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ${HOME}/bin/linaro-cp.py

# Cache upload is not required for nightly build
if [ -e $COPY_FROM ]
then

  ls -alR $COPY_FROM

  time python3 ${HOME}/bin/linaro-cp.py \
    $COPY_FROM \
    $PUBLISH_TO || true

  echo "Python wheels cached: https://snapshots.linaro.org/${PUBLISH_TO}"
fi

# Now is time to upload tensorflow

SHORT_JOB_NAME=$(echo $JOB_NAME | cut -d'/' -f1)

case $SHORT_JOB_NAME in

  "ldcg-python-manylinux-tensorflow-nightly")
    OUTPUT_PATH="ldcg/python/tensorflow-manylinux-nightly/$(date -u +%Y%m%d)-${BUILD_NUMBER}/"
    ;;

  "ldcg-python-manylinux-tensorflow-onednn-nightly")
    OUTPUT_PATH="ldcg/python/tensorflow-onednn-manylinux-nightly/$(date -u +%Y%m%d)-${BUILD_NUMBER}/"
    ;;

  "ldcg-python-manylinux-tensorflow")
    OUTPUT_PATH="ldcg/python/tensorflow-manylinux/${BUILD_NUMBER}/"
    ;;

  "ldcg-python-manylinux-tensorflow-io")
    OUTPUT_PATH="ldcg/python/tensorflow-io-manylinux/${BUILD_NUMBER}/"
    ;;

  "ldcg-python-manylinux-tensorflow-text")
    OUTPUT_PATH="ldcg/python/tensorflow-text-manylinux/${BUILD_NUMBER}/"
    ;;

esac

ls -alR ${WORKSPACE}/wheels

time python3 ${HOME}/bin/linaro-cp.py \
  --link-latest \
  ${WORKSPACE}/wheels \
  $OUTPUT_PATH || true

echo "Python wheels: https://snapshots.linaro.org/$OUTPUT_PATH"