Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated python version + new builds #161

Merged
merged 27 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6421db3
WIP #160
fabricebrito Nov 20, 2023
5359ac5
adds CI for docker and uses python 3.10
fabricebrito Nov 21, 2023
d4ead21
CI fixes
fabricebrito Nov 21, 2023
156fe10
pins shellescape==3.4.1
fabricebrito Nov 21, 2023
1b9855b
updates Dockerfile and requirements
fabricebrito Nov 21, 2023
b52066b
circleci python 3.10
fabricebrito Nov 21, 2023
bd2c7c8
add nose2 to circleci
fabricebrito Nov 21, 2023
845f319
CI docker
fabricebrito Nov 21, 2023
2796734
CI docker
fabricebrito Nov 21, 2023
84e20b1
github action instead of circle ci
fabricebrito Nov 21, 2023
e1846ed
python ci
fabricebrito Nov 21, 2023
dc2fd50
faster CI
fabricebrito Nov 21, 2023
3b3afa2
pins ci python
fabricebrito Nov 21, 2023
28c901f
CI python 3.10 tests
fabricebrito Nov 21, 2023
9bed896
CI python 3.10
fabricebrito Nov 21, 2023
c3c1c65
separated build
emmanuelmathot Nov 22, 2023
f1ccffd
venv in tests
emmanuelmathot Nov 22, 2023
79bac57
tests
emmanuelmathot Nov 22, 2023
a39abd0
pyton 3.10
emmanuelmathot Nov 22, 2023
a000313
simplified
emmanuelmathot Nov 22, 2023
40253be
Add git tag verification and separate build and
emmanuelmathot Nov 22, 2023
d3f2ea0
GITHUB_REF_NAME
emmanuelmathot Nov 22, 2023
eec8725
Update GitHub Actions checkout version
emmanuelmathot Nov 22, 2023
c70e0b8
Add venv activation before twine upload
emmanuelmathot Nov 22, 2023
16473ca
Update package.yaml to include PyPI credentials
emmanuelmathot Nov 22, 2023
08c296b
Add environment variables for publishing to PyPI
emmanuelmathot Nov 22, 2023
80aa33a
final builds
emmanuelmathot Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 0 additions & 84 deletions .circleci/config.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: build
on: [push, pull_request]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python3 -m venv venv
. venv/bin/activate
pip install setuptools wheel twine
pip install -r requirements.txt
- name: run tests
env:
RETRY_ATTEMPTS: 1
run: |
. venv/bin/activate
pip install nose2
nose2
65 changes: 65 additions & 0 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: package
on:
release:
types: [created]

jobs:

version:
runs-on: ubuntu-latest
outputs:
app-version: ${{ steps.set-version.outputs.version }}
steps:
- uses: actions/checkout@v4
- run: echo "APP_VERSION=$(python setup.py --version)" >> $GITHUB_ENV
- run: echo app version is $APP_VERSION
- id: set-version
run: echo "::set-output name=version::$APP_VERSION"

deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python3 -m venv venv
. venv/bin/activate
pip install setuptools wheel twine
pip install -r requirements.txt
- name: verify git tag vs. version
run: |
python3 -m venv venv
. venv/bin/activate
python setup.py verify
- name: Build
run: |
. venv/bin/activate
python setup.py bdist_wheel --universal
- name: Publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }}
run: |
. venv/bin/activate
twine upload dist/*

container-build:
needs: version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo version ${{needs.version.outputs.app-version}}
- run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: build & push image
run: |
IMAGE_ID=ghcr.io/duke-gcb/calrissian/calrissian
docker build . --file Dockerfile --tag calrissian
docker tag calrissian $IMAGE_ID:${{needs.version.outputs.app-version}}
docker push $IMAGE_ID:${{needs.version.outputs.app-version}}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ tests/__pycache__/
env37
build
*.egg
env-calrissian*
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7
FROM python:3.10.0-slim-buster
LABEL maintainer="dan.leehr@duke.edu"

# cwltool requires nodejs
Expand Down
4 changes: 2 additions & 2 deletions calrissian/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def read_yaml(filename):


def quoted_arg_list(arg_list):
shouldquote = needs_shell_quoting_re.search
return [shellescape.quote(arg) if shouldquote(arg) else arg for arg in arg_list]
shouldquote = needs_shell_quoting_re.search
return [shellescape.quote(arg) if shouldquote(arg) else arg for arg in arg_list]


def total_size(outputs):
Expand Down
2 changes: 1 addition & 1 deletion calrissian/k8s.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List, Union
from kubernetes import client, config, watch
from kubernetes.client.models import V1ContainerState, V1Container, V1ContainerStatus
from kubernetes.client.api_client import ApiException
from kubernetes.client.rest import ApiException
from kubernetes.config.config_exception import ConfigException
from calrissian.executor import IncompleteStatusException
from calrissian.retry import retry_exponential_if_exception_type
Expand Down
8 changes: 8 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
urllib3
kubernetes
cwltool
tenacity
importlib-metadata
msgpack
typing-extensions
freezegun
160 changes: 147 additions & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,147 @@
cwltool==3.1.20230601100705
freezegun==0.3.12
kubernetes==10.0.1
mypy-extensions==0.4.3
nose2==0.9.1
PyYAML==5.4
requests==2.28.1
scandir==1.10.0
schema-salad>=8.2.20210914115719,<9
shellescape>=3.4.1,<3.5
tenacity==5.1.1
typing-extensions==3.7.4
msgpack==0.5.2
#
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile
#
argcomplete==3.1.6
# via cwltool
cachecontrol[filecache]==0.13.1
# via schema-salad
cachetools==5.3.2
# via google-auth
certifi==2023.11.17
# via
# kubernetes
# requests
charset-normalizer==3.3.2
# via requests
coloredlogs==15.0.1
# via cwltool
cwl-upgrader==1.2.10
# via cwl-utils
cwl-utils==0.31
# via cwltool
cwltool==3.1.20231114134824
# via -r requirements.in
filelock==3.13.1
# via cachecontrol
freezegun==1.2.2
# via -r requirements.in
google-auth==2.23.4
# via kubernetes
humanfriendly==10.0
# via coloredlogs
idna==3.4
# via requests
importlib-metadata==6.8.0
# via -r requirements.in
importlib-resources==6.1.1
# via
# cwltool
# schema-salad
isodate==0.6.1
# via rdflib
kubernetes==28.1.0
# via -r requirements.in
lxml==4.9.3
# via prov
mistune==2.0.5
# via schema-salad
msgpack==1.0.7
# via
# -r requirements.in
# cachecontrol
mypy-extensions==1.0.0
# via
# cwltool
# schema-salad
networkx==3.2.1
# via prov
oauthlib==3.2.2
# via
# kubernetes
# requests-oauthlib
packaging==23.2
# via cwl-utils
prov==1.5.1
# via cwltool
psutil==5.9.6
# via cwltool
pyasn1==0.5.0
# via
# pyasn1-modules
# rsa
pyasn1-modules==0.3.0
# via google-auth
pydot==1.4.2
# via cwltool
pyparsing==3.1.1
# via
# cwltool
# pydot
# rdflib
python-dateutil==2.8.2
# via
# freezegun
# kubernetes
# prov
pyyaml==6.0.1
# via kubernetes
rdflib==7.0.0
# via
# cwl-utils
# cwltool
# prov
# schema-salad
requests==2.31.0
# via
# cachecontrol
# cwl-utils
# cwltool
# kubernetes
# requests-oauthlib
# schema-salad
requests-oauthlib==1.3.1
# via kubernetes
rsa==4.9
# via google-auth
ruamel-yaml==0.18.5
# via
# cwl-upgrader
# cwl-utils
# cwltool
# schema-salad
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
schema-salad==8.4.20231117150958
# via
# cwl-upgrader
# cwl-utils
# cwltool
shellescape==3.4.1
# via cwltool
six==1.16.0
# via
# isodate
# kubernetes
# prov
# python-dateutil
tenacity==8.2.3
# via -r requirements.in
typing-extensions==4.8.0
# via -r requirements.in
urllib3==1.26.18
# via
# -r requirements.in
# kubernetes
# requests
websocket-client==1.6.4
# via kubernetes
zipp==3.17.0
# via
# importlib-metadata
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# setuptools
Loading