-
Notifications
You must be signed in to change notification settings - Fork 48
134 lines (125 loc) · 3.98 KB
/
ci.yaml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: CI/CD
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- name: install requirements
run: |
python -m pip install -U pip setuptools wheel
python -m pip install pre-commit tox
- name: run pre-commit
run: pre-commit run -a
- name: mypy (sdk)
run: |
cd compute_sdk
tox -e mypy
- name: mypy (endpoint)
run: |
cd compute_endpoint
tox -e mypy
# ensure docs can build, imitating the RTD build as best we can
check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: build docs
run: make docs
safety-check-endpoint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: install requirements
run: |
python -m pip install -U pip setuptools
python -m pip install './compute_sdk' './compute_endpoint'
python -m pip install safety
rm -rf /opt/hostedtoolcache/Python/*/x64/lib/python3.*/site-packages/pip-23.{0,1,2}*
- name: run safety check
run: safety check
test-sdk:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
name: "Test SDK on py${{ matrix.python-version }} x ${{ matrix.os }} "
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -U pip setuptools
- run: python -m pip install tox
- name: run tests
run: |
cd compute_sdk
tox -e py
test-endpoint:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq
ports:
- 5672:5672
# needed because the rabbitmq container does not provide a healthcheck
options: --health-cmd "rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_virtual_hosts && rabbitmq-diagnostics -q check_port_connectivity" --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
name: "Test Endpoint on py${{ matrix.python-version }} x ${{ matrix.os }} "
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -U pip setuptools
- run: python -m pip install tox
- name: run tests
run: |
cd compute_endpoint
tox -e py -- --log-cli-level=ERROR
- name: Collect Docker Logs
if: failure()
uses: jwalton/[email protected]
publish:
# only trigger on pushes to the main repo (not forks, and not PRs)
if: ${{ github.repository == 'funcx-faas/funcX' && github.event_name == 'push' }}
needs:
- lint
- test-sdk
- test-endpoint
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@master
- name: Extract tag name
shell: bash
run: echo "##[set-output name=imagetag;]$(echo ${GITHUB_REF##*/})"
id: extract_tag_name
- name: Build globus-compute-endpoint Image for selected python version
uses: elgohr/Publish-Docker-Github-Action@master
env:
PYTHON_VERSION: ${{ matrix.python }}
with:
dockerfile: Dockerfile-endpoint
name: funcx/kube-endpoint:${{ steps.extract_tag_name.outputs.imagetag }}-${{ matrix.python }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
buildargs: PYTHON_VERSION