Skip to content

Commit 8c5da0c

Browse files
greenapeThingus
andcommitted
Initial commit
Co-Authored-By: Thingus <3050091+Thingus@users.noreply.github.com>
0 parents  commit 8c5da0c

61 files changed

Lines changed: 11957 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
#Use the latest 2.1 version of CircleCI pipeline process engine.
2+
# See: https://circleci.com/docs/configuration-reference
3+
version: 2.1
4+
jobs:
5+
test:
6+
machine:
7+
image: ubuntu-2204:current
8+
environment:
9+
DOCKER_SOCKET: /run/docker.sock
10+
steps:
11+
- checkout # checkout source code to working directory
12+
- run:
13+
name: Run tests
14+
command: |
15+
# Open permission on docker.sock to allow containers to spawn other containers
16+
sudo chmod 777 /run/docker.sock
17+
# Touching requirements files here so that make doesn't rebuild them - we can't rely on file timestamps in a fresh repo clone
18+
touch requirements.txt dev-requirements.txt
19+
make CI=true dev-sync
20+
docker login -u $DOCKER_CLOUD_USER -p $DOCKER_CLOUD_PASSWORD
21+
airflow db migrate
22+
export AIRFLOW_VAR_FLOWAPI_TOKEN="set_in_host"
23+
export CONTAINER_TAG=$CIRCLE_SHA1
24+
export FLOWKIT_VERSION=$(cat .flowkit-version)
25+
cd tests
26+
pytest --junitxml=test_out.xml .
27+
- store_test_results:
28+
path: tests/test_out.xml
29+
test_pypi_publish:
30+
docker:
31+
- image: cimg/python:3.10
32+
steps:
33+
- checkout # checkout source code to working directory
34+
- run:
35+
name: Create and upload wheel to test pypi
36+
command: |
37+
pyenv local 3.10
38+
python3 setup.py sdist bdist_wheel
39+
sudo add-apt-repository universe -y
40+
sudo apt-get update
41+
sudo apt install -y python3-pip
42+
sudo pip install pipenv
43+
pipenv install twine
44+
pipenv run twine upload --repository testpypi dist/*
45+
46+
pypi_publish:
47+
docker:
48+
- image: cimg/python:3.10
49+
steps:
50+
- checkout # checkout source code to working directory
51+
- run:
52+
name: Create and upload wheel to pypi
53+
command: |
54+
pyenv local 3.10
55+
python3 setup.py sdist bdist_wheel
56+
sudo add-apt-repository universe -y
57+
sudo apt-get update
58+
sudo apt install -y python3-pip
59+
sudo pip install pipenv
60+
pipenv install twine
61+
pipenv run twine upload dist/*
62+
63+
build_docker_image:
64+
machine:
65+
image: ubuntu-2004:2023.10.1
66+
working_directory: /home/circleci/project/
67+
steps:
68+
- checkout:
69+
path: /home/circleci/project/
70+
- attach_workspace:
71+
at: /home/circleci
72+
- run: sudo apt update && sudo apt install docker-ce
73+
- run:
74+
name: Log in to docker cloud
75+
command: docker login --username $DOCKER_CLOUD_USER --password $DOCKER_CLOUD_PASSWORD
76+
- run:
77+
name: Build flowbot image
78+
command: |
79+
echo "Tagging as $CIRCLE_SHA1"
80+
export SOURCE_VERSION=$(git describe --tags --dirty --always | sed s/"-"/"+"/ | sed s/"-"/"."/g)
81+
DOCKER_BUILDKIT=1 docker build --progress=plain --build-arg FLOWETL_VERSION=$(cat .flowkit-version) --build-arg SOURCE_VERSION=$SOURCE_VERSION -t flowminder/flowbot:$CIRCLE_SHA1 -f Dockerfile .
82+
- run:
83+
name: Push images to Docker cloud
84+
command: |
85+
docker push flowminder/flowbot:$CIRCLE_SHA1
86+
87+
retag_image:
88+
parameters:
89+
tag:
90+
type: string
91+
default: "latest"
92+
docker:
93+
- image: cimg/python:3.7
94+
steps:
95+
- run:
96+
name: Install retagger
97+
command: wget -q https://github.com/joshdk/docker-retag/releases/download/0.0.2/docker-retag && sudo install docker-retag /usr/bin
98+
- run:
99+
name: Retag
100+
command: |
101+
export DOCKER_USER=$DOCKER_CLOUD_USER
102+
export DOCKER_PASS=$DOCKER_CLOUD_PASSWORD
103+
docker-retag flowminder/flowbot:$CIRCLE_SHA1 ${<< parameters.tag >>:-latest}
104+
105+
build_docs:
106+
docker:
107+
- image: cimg/python:3.12
108+
working_directory: /home/circleci/project/docs
109+
steps:
110+
- checkout:
111+
path: /home/circleci/project/
112+
- run: pip install -r requirements.txt
113+
- run: mkdocs build
114+
- run: zip -r flowpyter-task-docs.zip flowpyter-task-docs/*
115+
- store_artifacts:
116+
path: /home/circleci/project/docs/flowpyter-task-docs.zip
117+
destination: docs
118+
119+
deploy_docs:
120+
docker:
121+
- image: cimg/python:3.12
122+
working_directory: /home/circleci/project/docs
123+
steps:
124+
- checkout:
125+
path: /home/circleci/project/
126+
- run: pip install -r requirements.txt
127+
- run: git fetch origin gh-pages --depth=1
128+
- run:
129+
name: Set git committer
130+
command: |
131+
git config user.name $GIT_COMMITTER_NAME
132+
git config user.email $GIT_COMMITTER_EMAIL
133+
- run: mike deploy --push --update-aliases ${CIRCLE_TAG:="main"} latest
134+
135+
workflows:
136+
test_publish:
137+
jobs:
138+
- test:
139+
context: org-global
140+
filters:
141+
tags:
142+
only: /.*/
143+
requires:
144+
- build_docker_image
145+
- build_docs:
146+
context: org-global
147+
filters:
148+
tags:
149+
only: /.*/
150+
- deploy_docs:
151+
context: org-global
152+
filters:
153+
branches:
154+
only:
155+
- main
156+
tags:
157+
only: /.*/
158+
requires:
159+
- build_docs
160+
- test
161+
- build_docker_image
162+
- test_pypi_publish:
163+
requires:
164+
- test
165+
context: test-pypi
166+
filters:
167+
branches:
168+
only:
169+
- test_upload
170+
- pypi_publish:
171+
requires:
172+
- test
173+
context: org-global
174+
filters:
175+
branches:
176+
only:
177+
- main
178+
tags:
179+
only: /.*/
180+
- build_docker_image:
181+
context: org-global
182+
filters:
183+
tags:
184+
only: /.*/
185+
- retag_image:
186+
name: retag_master_branch
187+
requires: &retag_requirements
188+
- test
189+
- build_docker_image
190+
context: org-global
191+
filters:
192+
branches:
193+
only:
194+
- main
195+
tags:
196+
only: /.*/

.dockerignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
# This .dockerignore file follows the "whitelisting" approach described here:
5+
# https://youknowfordevs.com/2018/12/07/getting-control-of-your-dockerignore-files.html
6+
7+
#
8+
# First, exclude everything by default:
9+
#
10+
11+
*
12+
13+
#
14+
# Now un-exclude only those folders and files that are needed for building the image:
15+
#
16+
!src/*
17+
!setup.py
18+
!pyproject.toml
19+
!setup.cfg
20+
!versioneer.py
21+
!LICENSE
22+
!requirements.txt

.flowkit-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.30.0

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
src/flowpyter-task/_version.py export-subst
2+
src/_version.py export-subst
3+
src/flowpytertask/_version.py export-subst

.gitignore

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# PyCharm
156+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158+
# and can be added to the global gitignore or merged into this file. For a more nuclear
159+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160+
#.idea/
161+
tests/notebooks_out/
162+
tests/data/
163+
docs/flowpyter-task-docs
164+
*/.DS_Store
165+
docs/source/.DS_Store
166+
.idea
167+
168+
!tests/.env

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10.13

0 commit comments

Comments
 (0)