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

Workflow v2 #569

Open
wants to merge 529 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
529 commits
Select commit Hold shift + click to select a range
54fa563
reduce num tries to 3
aamster Jun 30, 2023
7cba540
add readme for testing
aamster Jun 30, 2023
f39be32
fix docstring
aamster Jul 10, 2023
a49e2ab
set passed_or_qc_only to true for container
aamster Jul 10, 2023
574f9da
improve formatting of readme
aamster Jul 10, 2023
7f5b4e9
add test for container has completed workflow step
aamster Jul 10, 2023
a24b96a
add additional doc for http_body
aamster Jul 10, 2023
3a855bd
Merge pull request #591 from AllenInstitute/dev/workflow_debug_mode
aamster Jul 11, 2023
d4a2c56
add dockerfile and values.yaml
aamster Jul 20, 2023
0acd7aa
fix Dockerfile
aamster Jul 20, 2023
6a49153
try modify extras
aamster Jul 20, 2023
24dba26
try install libgl1
aamster Jul 20, 2023
63a8ed8
remove comma
aamster Jul 20, 2023
ed31d89
add another install
aamster Jul 20, 2023
b6a27a9
try using aws cli within docker image
aamster Jul 20, 2023
050e4eb
try pulling files directly in image
aamster Jul 21, 2023
66b2f3b
fix paths
aamster Jul 21, 2023
df9b4fb
fix paths
aamster Jul 21, 2023
a8bcd54
fully qualify host names
aamster Jul 24, 2023
eb4cb29
fully qualify host name
aamster Jul 24, 2023
4adc1db
add argument to initialize app db
aamster Jul 24, 2023
f3c656b
add backslash
aamster Jul 24, 2023
decfeb3
exit if required args not passed
aamster Jul 24, 2023
ffbf29b
fix
aamster Jul 24, 2023
1bf5b64
fix
aamster Jul 24, 2023
27fd311
fix
aamster Jul 24, 2023
586e13f
fix
aamster Jul 24, 2023
9ef3200
fix
aamster Jul 24, 2023
bfdc5a9
remove logic to get custom webserver ip address (doesnt work in helm …
aamster Jul 25, 2023
4c6aaef
parameterize branch name
aamster Jul 25, 2023
fbfc1da
add airflow-amazon provider
aamster Jul 26, 2023
5db55aa
change name to host_name
aamster Jul 26, 2023
e1aa69a
use version of app_config so we don't have to rebuild without caching
aamster Jul 26, 2023
c3294ae
set default value for app_config_s3_version_id
aamster Jul 26, 2023
5c87eca
revert previous 2 commits
aamster Jul 26, 2023
0bb6f2a
dont make dirs (doesnt have write access, let module running in slurm…
aamster Jul 26, 2023
2b2fb8a
write logs to module output, rather than airflow task output
aamster Jul 26, 2023
9024170
remove makedirs in another place
aamster Jul 26, 2023
8e7cf85
revert adding amazon provider
aamster Jul 27, 2023
344e365
remove unused args
aamster Jul 27, 2023
5905197
Merge branch 'prod_deploy' of https://github.com/AllenInstitute/ophys…
aamster Jul 27, 2023
fe26d76
Revert "dont make dirs (doesnt have write access, let module running …
aamster Jul 27, 2023
b7b8eeb
Revert "write logs to module output, rather than airflow task output"
aamster Jul 27, 2023
7a60069
Revert "remove makedirs in another place"
aamster Jul 27, 2023
463295c
add psycopg2
aamster Jul 28, 2023
71e677c
fix dep name
aamster Jul 28, 2023
9a659dc
revert add dep
aamster Jul 29, 2023
9ecbbbc
add back in dep
aamster Jul 29, 2023
635a01e
Revert "add back in dep"
aamster Jul 29, 2023
3d42660
set start_date to yesterday to avoid race condition
aamster Jul 31, 2023
ed3a12f
add additional steps to readme
aamster Jul 31, 2023
27ebf5e
add host user to docker image
aamster Jul 31, 2023
2c61a15
move slurm settings into app config
aamster Jul 31, 2023
3c524ea
use dags internally downloaded in dockerfile rather than local to avo…
aamster Aug 1, 2023
1f1e07e
add details in readme
aamster Aug 1, 2023
35e6aa2
remove unused import
aamster Aug 1, 2023
3288e59
fix issue in which wrong task is selected to be retried on failure
aamster Aug 1, 2023
5abda08
no longer copy di model into docker image
aamster Aug 1, 2023
dfb83f8
add debugging steps
aamster Aug 1, 2023
01cfe3b
add more logging
aamster Aug 2, 2023
a430086
set to <=
aamster Aug 2, 2023
01e0466
add comment
aamster Aug 2, 2023
cccf728
fix issue with passing --nv and gpus: 0
aamster Aug 2, 2023
6a8b856
remove app db creation from dockerfile
aamster Aug 3, 2023
ab74391
add object type and id to run id in order to search for it in UI
aamster Aug 3, 2023
c951403
fix typo
aamster Aug 3, 2023
8053270
fix retry logic. The value in config is number of retries, not number…
aamster Aug 4, 2023
910d52f
parameterize partition
aamster Aug 7, 2023
67f5c22
set start_date in the past according to https://airflow.apache.org/do…
aamster Aug 7, 2023
c2cd5f0
remove unused imports
aamster Aug 7, 2023
d49bf21
create new object rather than set values (immutable)
aamster Aug 7, 2023
bdade83
bugfix: use max_active_runs=1 instead of more complicated logic
aamster Aug 7, 2023
3153d33
add logging
aamster Aug 7, 2023
4b81aaf
bugfix: logical_date is not the time when the trigger was run but the…
aamster Aug 8, 2023
fbaac43
Merge pull request #594 from AllenInstitute/prod_deploy
aamster Aug 8, 2023
7b10904
make dockerfile compatible with either dev or prod
aamster Aug 10, 2023
2a93744
add docker-compose.yaml
aamster Aug 10, 2023
ffce621
update readme
aamster Aug 10, 2023
9ee1ba1
postgres stored separately for each container
aamster Aug 11, 2023
89e46b1
remove AIRFLOW_PROJ_DIR
aamster Aug 12, 2023
c913b9a
add note
aamster Aug 12, 2023
9861d05
Use argschema validation to load inputs on PipelineModules
mikejhuang Aug 15, 2023
f122367
pin tensorflow version
aamster Aug 15, 2023
dc47bca
"conda init" not working.
aamster Aug 15, 2023
5992101
fix missing comma
aamster Aug 15, 2023
178427d
explicitly pass coverage path
aamster Aug 15, 2023
eae9d11
explicitly pass coverage exe path
aamster Aug 15, 2023
d2fae66
try different default value
aamster Aug 15, 2023
6041f22
try again
aamster Aug 15, 2023
9535ce0
try again
aamster Aug 15, 2023
b23830a
Update PipelineModule to enforce module_argschema and validate inputs
mikejhuang Aug 16, 2023
c7cc0d0
update all PipelineModule classes to use validation setup, rename cla…
mikejhuang Aug 16, 2023
ed8c1c4
use lower version tensorflow
aamster Aug 16, 2023
4e5101c
add missing property
aamster Aug 16, 2023
1bfe54a
update TestPipelineModule with validation modifications
mikejhuang Aug 16, 2023
e81d988
download img to tmpdir, disable caching
aamster Aug 16, 2023
4a1baf0
rename test_<pipelinemodule> to test_<pipelinemodule>_module to preve…
mikejhuang Aug 17, 2023
7250736
change typing of schema to DefaultSchema instead of Argschema
mikejhuang Aug 17, 2023
4653308
init pipelinemodule after class instance variables on eventdetection
mikejhuang Aug 21, 2023
0d4cff0
add tempdir and dummy file in TestSlurm for MotionCorrectionModule va…
mikejhuang Aug 21, 2023
d841eaa
adds timestamp to log
aamster Aug 21, 2023
07b85a4
mock PipelineModule.output_path and OphysSession.output_dir to a temp…
mikejhuang Aug 21, 2023
eed128b
use tempfile for slurm test output_paths
mikejhuang Aug 22, 2023
9be9433
temporarily update di branch
aamster Aug 22, 2023
ae4528c
set stream to stdout
aamster Aug 22, 2023
dd63152
mock input_args_path on test_pipeline_module with tempdir
mikejhuang Aug 22, 2023
3fb3f4c
remove unused files
mikejhuang Aug 22, 2023
14663ff
rename module_argschema to module_schema
mikejhuang Aug 22, 2023
6932805
increase finetuning timelimit
aamster Aug 22, 2023
168b6cf
removed unused imports
mikejhuang Aug 22, 2023
2061896
lint
mikejhuang Aug 22, 2023
c879b28
change inputs to a property
mikejhuang Aug 22, 2023
bb10e1b
update readme
aamster Aug 24, 2023
61416a1
add UID to container name
aamster Aug 24, 2023
03d2272
make tagname unique
aamster Aug 24, 2023
f6b2717
switch di branch
aamster Aug 25, 2023
39066a8
it is possible for a single job id to map to multiple jobs in the cas…
aamster Aug 25, 2023
f76215b
remove dir empty check (it's possible to be empty)
aamster Aug 25, 2023
8a088df
remove unused args
aamster Aug 25, 2023
ba98ba0
update test
aamster Aug 25, 2023
ae87845
update test
aamster Aug 25, 2023
adc734d
Check that all experiments have completed segmentation in order to ru…
aamster Aug 25, 2023
408f046
manually kill process
aamster Aug 27, 2023
5eb02f8
disable kill process when running in pytest
aamster Aug 27, 2023
4762e53
Add details about app_config.yml
aamster Aug 28, 2023
f6cd784
Merge pull request #595 from AllenInstitute/docker_dev_env
aamster Aug 28, 2023
c22f93b
Merge pull request #598 from AllenInstitute/dev_unique_tagname
aamster Aug 28, 2023
72baa6b
try clear_session()
aamster Aug 28, 2023
09cf0d2
remove module_args and only use inputs
mikejhuang Aug 29, 2023
7ba02b0
try disabling multiprocessing
aamster Aug 29, 2023
4b4c46a
Merge branch 'workflow_v2' of https://github.com/AllenInstitute/ophys…
aamster Aug 29, 2023
8e05594
update repo for di
aamster Aug 30, 2023
8ce37b3
update nb_workers
aamster Aug 30, 2023
ed5f2f0
trace_processing pipeline modules unit tests and fixes
mikejhuang Aug 31, 2023
5c27f9d
reorder pipeline module super init to after module kwargs
mikejhuang Aug 31, 2023
111634d
refactor tests to share fixtures/db from conftest
mikejhuang Sep 5, 2023
1006ad9
fix bug
mikejhuang Sep 5, 2023
2981c7c
additional tests
mikejhuang Sep 5, 2023
2bea106
refactor conftest to deal with fixtures in setup
mikejhuang Sep 5, 2023
97ba148
increase trigger interval to 60 minutes
mikejhuang Sep 5, 2023
c075915
additional test fixes
mikejhuang Sep 6, 2023
89896fc
change di branch to main branch
aamster Sep 6, 2023
7546bfc
Merge pull request #600 from AllenInstitute/dev_fix_tf_version
aamster Sep 6, 2023
f055438
fix or remove roi_classification tests
mikejhuang Sep 6, 2023
53a1fc9
remove unused imports
mikejhuang Sep 7, 2023
8ef7539
lint
mikejhuang Sep 7, 2023
a8905fb
remove commented code
mikejhuang Sep 7, 2023
985b0a9
circleci test config for deepinterpolation pipelinemodule tests
mikejhuang Sep 7, 2023
6998f48
Merge branch 'workflow_v2' into psb-133/validate_inputs_with_argschema
mikejhuang Sep 7, 2023
808f155
lint
mikejhuang Sep 7, 2023
a9b6e18
increase denoising inference timeout
aamster Sep 7, 2023
875753e
set static start_date
aamster Sep 7, 2023
09a7ff8
Merge branch 'workflow_v2' of https://github.com/AllenInstitute/ophys…
aamster Sep 7, 2023
7919b49
pytest mark test build config
mikejhuang Sep 7, 2023
0e135a2
parameterize nonrigid
aamster Sep 8, 2023
794e91a
skip denoising imports if not found
mikejhuang Sep 8, 2023
cb84a7d
add denoising test class to try
mikejhuang Sep 11, 2023
8cdea9c
Merge pull request #603 from AllenInstitute/add_nonrigid
aamster Sep 11, 2023
09487f7
address test comments
mikejhuang Sep 12, 2023
b050588
lint
mikejhuang Sep 12, 2023
05e078e
revert TrainScehma
mikejhuang Sep 12, 2023
880dab0
should be pytest.mark.skip
mikejhuang Sep 12, 2023
0abe605
change train schema
mikejhuang Sep 12, 2023
1e1233b
Allows to override some slurm settings while retaining defaults defin…
aamster Sep 13, 2023
a47e691
revert accidental change
aamster Sep 13, 2023
6745ea5
Merge pull request #604 from AllenInstitute/override_some_app_config
aamster Sep 13, 2023
56bc72c
try fix issue with import libstdc++.so.6
aamster Sep 13, 2023
7acb478
Merge branch 'workflow_v2' of https://github.com/AllenInstitute/ophys…
aamster Sep 13, 2023
9c81805
export ld_library_path
aamster Sep 13, 2023
1156423
remove database setup in trace_processing tests
mikejhuang Sep 14, 2023
3a9e6db
remove unused import
mikejhuang Sep 14, 2023
bda948d
remove unneeded db setup in roi_classification tests
mikejhuang Sep 14, 2023
71b8f1b
Merge branch 'workflow_v2' into psb-133/validate_inputs_with_argschema
mikejhuang Sep 14, 2023
355b0fc
remove unnecessary db setup from denoising and associated class from …
mikejhuang Sep 15, 2023
7634e46
remove uneeded db setup from roi_classifier tests
mikejhuang Sep 18, 2023
6f92ae2
add test_input for segmentation_postprocess, fix module input
mikejhuang Sep 21, 2023
a388f5b
add constructor to motion correction pipelinemodule
mikejhuang Sep 21, 2023
c6c1308
add test_input for motion correction
mikejhuang Sep 21, 2023
82ef0cf
remove module from test filenames and add init file in dir with non u…
mikejhuang Sep 21, 2023
446cd86
lint
mikejhuang Sep 21, 2023
0635a3f
Merge pull request #601 from AllenInstitute/psb-187/increase_ophys_tr…
mikejhuang Sep 21, 2023
5746580
remove erroneously added test cache dir
mikejhuang Sep 21, 2023
e612ed3
bugfix: get motion border for experiment
aamster Sep 22, 2023
0acc3dd
remove unnecessary constructor
mikejhuang Sep 23, 2023
eef5049
Merge pull request #596 from AllenInstitute/psb-133/validate_inputs_w…
mikejhuang Sep 23, 2023
2605b8c
disable normalize_cache, enable gpu
mikejhuang Sep 25, 2023
9b0d812
Merge pull request #609 from AllenInstitute/psb-218/disable-inference…
mikejhuang Sep 25, 2023
8a6883b
Merge pull request #608 from AllenInstitute/fix_motion_border
aamster Sep 26, 2023
085428a
make wait_for_dag_to_finish more generic
aamster Sep 27, 2023
8feec8e
try unpin argschema
aamster Sep 28, 2023
8a506a7
pin argschema to higher version
aamster Sep 28, 2023
b0b53e6
Merge branch 'workflow_v2' of https://github.com/AllenInstitute/ophys…
aamster Sep 28, 2023
8384adf
try set AIRFLOW_HOME
aamster Sep 28, 2023
342331b
set AIRFLOW_HOME to tmpdir
aamster Sep 28, 2023
bb17a47
move wait_for_dag_to_finish import later
aamster Sep 28, 2023
4d67ce5
try unpin argschema
aamster Sep 28, 2023
40c2ceb
Merge pull request #614 from AllenInstitute/dev/psb-210
aamster Sep 28, 2023
0c38f39
sets sensitive configs from airflow Variable
aamster Oct 4, 2023
ef3cdd9
set airflow_home in conftest.py
aamster Oct 4, 2023
29eb961
add empty_roi_mask and empty_neuropil_mask exclusion labels to OphysROI
mikejhuang Oct 5, 2023
8b82fd5
Add deploy script
aamster Oct 5, 2023
a0bf0b5
lint
aamster Oct 5, 2023
e81d0ba
Merge pull request #615 from AllenInstitute/app_config_secrets
aamster Oct 6, 2023
69d5f00
Merge pull request #616 from AllenInstitute/deploy_script
aamster Oct 6, 2023
7724832
bugfix: superclass constructor needs to be called before _write_model…
aamster Oct 6, 2023
66bad5a
remove unused imports
aamster Oct 6, 2023
998b3cf
add save_exclusion_labels_to_db to trace_extraction pipeline mod
mikejhuang Oct 6, 2023
6247c90
refactor segmentation test with fixtures
mikejhuang Oct 6, 2023
5a92555
add test for save_db_to_workflow in trace_extraction pipeline mod
mikejhuang Oct 6, 2023
2d607de
remove unused imports
mikejhuang Oct 6, 2023
c8366dc
lint
mikejhuang Oct 7, 2023
4817262
add save_exclusion_labels_to_db to task_group additional_inserts
mikejhuang Oct 7, 2023
d1696fd
lint
mikejhuang Oct 7, 2023
46840ff
Increase timelimit on dff
aamster Oct 9, 2023
51041b2
Increase mem on decrosstalk
aamster Oct 9, 2023
7b18952
try also install amazon providers package
aamster Oct 9, 2023
2c4c3de
Merge branch 'workflow_v2' of https://github.com/AllenInstitute/ophys…
aamster Oct 9, 2023
2c73e85
use python 3.8 version
aamster Oct 9, 2023
f06d907
get current commit before deploying
aamster Oct 9, 2023
341e64c
Merge pull request #617 from AllenInstitute/ticket/psb-239
aamster Oct 10, 2023
7ffb78c
PSB-244 Increase timeout on trace extraction
aamster Oct 10, 2023
8ed7f6c
PSB-247 Increase mem limit on corr proj
aamster Oct 10, 2023
cc1dd10
remove empty_roi_mask flag
mikejhuang Oct 11, 2023
7a1d65a
extra logic in PostProcessROIs to ensure segmented roi's aren't empty
mikejhuang Oct 11, 2023
87a6308
various fixes
mikejhuang Oct 12, 2023
146e262
fix tests
mikejhuang Oct 12, 2023
2f8c89c
change typing
mikejhuang Oct 12, 2023
1dcbf0b
Merge pull request #618 from AllenInstitute/psb-242/add_trace_extract…
mikejhuang Oct 12, 2023
dd1666a
remove duplicate motion_border_check_logic
mikejhuang Oct 16, 2023
b1a0aa6
fix inside_motion_border logic
mikejhuang Oct 17, 2023
4ae2547
fix is_inside_motion_border function call
mikejhuang Oct 17, 2023
0099a70
fix save_metadata_to_db in trace_extraction
mikejhuang Oct 17, 2023
c51d8a5
lint
mikejhuang Oct 17, 2023
ec82bca
Fix arguments to CreateTrainTestSplit
aamster Oct 17, 2023
421f957
temporarily update branch
aamster Oct 17, 2023
161e898
noqa
aamster Oct 17, 2023
28ead56
update output_dir
aamster Oct 18, 2023
10cf74e
add test
aamster Oct 18, 2023
7fdf05f
Update to pull main branch
aamster Oct 18, 2023
a651590
Merge pull request #623 from AllenInstitute/ticket/psb-192
aamster Oct 18, 2023
e303a38
add edge cases for testing is_inside_motion_border
mikejhuang Oct 18, 2023
f163272
inside_motion_border reverted back to mean not overlapping motion border
mikejhuang Oct 18, 2023
39cff88
Merge branch 'workflow_v2' into psb-238/remove_redundant_motion_borde…
mikejhuang Oct 18, 2023
8235aa7
lint
mikejhuang Oct 18, 2023
ce885f7
docfix
mikejhuang Oct 20, 2023
dc54ecd
Merge pull request #622 from AllenInstitute/psb-238/remove_redundant_…
mikejhuang Oct 20, 2023
adf9b31
Merge branch 'main' into workflow_v2
morriscb Oct 25, 2023
b2f1dc5
fill rmse value with nan if traces contain nan
mikejhuang Sep 26, 2023
189d06c
fix
mikejhuang Nov 7, 2023
dbeca05
Merge pull request #611 from AllenInstitute/psb-222/neuropil_correcti…
mikejhuang Nov 7, 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
177 changes: 120 additions & 57 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,83 +3,155 @@ orbs:
python: circleci/[email protected]

commands:
build_and_test:
build_docker:
parameters:
build_name:
type: string
python_version:
type: string
tag:
type: string
dockerfile_name:
type: string
steps:
- checkout
- run:
name: Build docker image
name: Build << parameters.build_name >> docker image
command: |
docker build --build-arg OPHYS_ETL_TAG=${CIRCLE_BRANCH} --build-arg OPHYS_ETL_COMMIT_SHA=${CIRCLE_SHA1} --build-arg TEST_PYTHON_VERSION=<< parameters.python_version >> -t alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} .circleci/docker
docker build \
--build-arg OPHYS_ETL_TAG=${CIRCLE_BRANCH} \
--build-arg OPHYS_ETL_COMMIT_SHA=${CIRCLE_SHA1} \
--build-arg PYTHON_VERSION=<< parameters.python_version >> \
-t alleninstitutepika/ophys_etl_pipelines:<< parameters.tag >> \
-f docker/<<parameters.dockerfile_name>> docker/
test:
parameters:
test_name:
type: string
python_version:
type: string
docker_tag:
type: string
pytest_mark:
type: string
conda_env:
type: string
test_directory:
type: string
default: tests
coverage_executable_path:
type: string
steps:
- run:
name: Run docker image pytest
name: Run docker image << parameters.test_name >> tests
# docker runs should succeed with --read-only flag if expected to be
# run by singularity
# https://sylabs.io/guides/3.6/user-guide/singularity_and_docker.html#best-practices
command: |
set -e
mkdir /tmp/<< parameters.python_version >>
mkdir $PWD/coverage_outputs_<< parameters.python_version >>
# set entrypoint like this so we can handle quotes
docker run --entrypoint /bin/bash --read-only --tmpfs /tmp --mount type=bind,source=$PWD/coverage_outputs_<< parameters.python_version >>,target=/coverage_outputs_<< parameters.python_version >> alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} /repos/ophys_etl/.circleci/scripts/run_and_test.sh "not event_detect_only" << parameters.python_version >> ophys_etl general_cov.xml
bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN} -f $PWD/coverage_outputs_<< parameters.python_version >>/general_cov.xml -cF general_tests
set -e
mkdir -p $PWD/coverage_outputs_<< parameters.python_version >>

# set entrypoint like this so we can handle quotes
docker run \
--entrypoint /bin/bash \
--read-only \
--tmpfs /tmp \
-v $PWD/coverage_outputs_<<parameters.python_version>>:/coverage_outputs_<<parameters.python_version>> \
alleninstitutepika/ophys_etl_pipelines:<<parameters.docker_tag>> \
/repos/ophys_etl/.circleci/scripts/run_and_test.sh "<<parameters.pytest_mark>>" <<parameters.python_version>> <<parameters.conda_env>> <<parameters.test_name>>.xml <<parameters.test_directory>> <<parameters.coverage_executable_path>>

jobs:
docker:
machine:
image: ubuntu-2004:current

build_and_test:
parameters:
python_version:
type: string
steps:
- checkout
- run:
name: Build docker image
command: |
docker build --build-arg OPHYS_ETL_TAG=${CIRCLE_BRANCH} --build-arg OPHYS_ETL_COMMIT_SHA=${CIRCLE_SHA1} -t alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} docker/
- run:
name: Run docker image pytest
# docker runs should succeed with --read-only flag if expected to be
# run by singularity
# https://sylabs.io/guides/3.6/user-guide/singularity_and_docker.html#best-practices
command: |
set -e
mkdir $PWD/coverage_outputs_3.8
# set entrypoint like this so we can handle quotes
docker run --entrypoint /bin/bash --read-only --tmpfs /tmp -v $PWD/coverage_outputs_3.8:/coverage_outputs_3.8 alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} /repos/ophys_etl/.circleci/scripts/run_and_test.sh "event_detect_only" 3.8 event_detection event_cov.xml
bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN} -f $PWD/coverage_outputs_3.8/event_cov.xml -cF event_detection_tests
docker run --entrypoint /bin/bash --read-only --tmpfs /tmp -v $PWD/coverage_outputs_3.8:/coverage_outputs_3.8 alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} /repos/ophys_etl/.circleci/scripts/run_and_test.sh "not event_detect_only" 3.8 ophys_etl general_cov.xml
bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN} -f $PWD/coverage_outputs_3.8/general_cov.xml -cF general_tests
- build_docker:
build_name: "General+suite2p"
python_version: <<parameters.python_version>>
tag: ${CIRCLE_SHA1}
dockerfile_name: "Dockerfile"
- build_docker:
build_name: "DeepInterpolation only"
python_version: <<parameters.python_version>>
tag: deepinterpolation_${CIRCLE_SHA1}
dockerfile_name: "Dockerfile_deepinterpolation"
- test:
test_name: "event_detection"
python_version: <<parameters.python_version>>
docker_tag: ${CIRCLE_SHA1}
pytest_mark: "event_detect_only"
conda_env: event_detection
test_directory: tests/modules/event_detection/
coverage_executable_path: "/envs/event_detection/bin/coverage"
- test:
test_name: "deepinterpolation"
python_version: <<parameters.python_version>>
docker_tag: deepinterpolation_${CIRCLE_SHA1}
pytest_mark: deepinterpolation_only
conda_env: ophys_etl
test_directory: tests/modules/denoising/
coverage_executable_path: "/usr/local/bin/coverage"
- test:
test_name: "general"
python_version: <<parameters.python_version>>
docker_tag: ${CIRCLE_SHA1}
pytest_mark: "not event_detect_only and not deepinterpolation_only"
conda_env: ophys_etl
coverage_executable_path: "/envs/ophys_etl/bin/coverage"
smoke_test_and_push:
steps:
- run:
name: Run docker image smoke test
command: |
set -e
docker run --read-only --tmpfs /tmp alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} /envs/ophys_etl/bin/python -m ophys_etl.modules.suite2p_wrapper --h5py /repos/ophys_etl/tests/modules/suite2p_wrapper/resources/movie_100x100x100.h5 --output_dir /tmp --movie_frame_rate 1.0 --log_level INFO --output_json /tmp/output.json
set -e
docker run \
--read-only \
--tmpfs /tmp \
alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} \
/envs/ophys_etl/bin/python -m ophys_etl.modules.suite2p_wrapper \
--h5py \
/repos/ophys_etl/tests/modules/suite2p_wrapper/resources/movie_100x100x100.h5 \
--output_dir /tmp \
--movie_frame_rate 1.0 \
--log_level INFO \
--output_json /tmp/output.json
- run:
name: Upload docker image
command: |
echo "$DOCKER_PASS" | docker login --username $DOCKER_USER --password-stdin
if [ "$CIRCLE_BRANCH" = "main" ]
then
docker tag alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} alleninstitutepika/ophys_etl_pipelines:main
docker push alleninstitutepika/ophys_etl_pipelines:main
else
docker tag alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} alleninstitutepika/ophys_etl_pipelines:develop
docker push alleninstitutepika/ophys_etl_pipelines:develop
fi
docker tag alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} alleninstitutepika/ophys_etl_pipelines:main_${CIRCLE_SHA1}
docker push alleninstitutepika/ophys_etl_pipelines:main_${CIRCLE_SHA1}

build377:
machine:
image: ubuntu-2004:current
steps:
- build_and_test:
python_version: "3.7.7"
docker tag alleninstitutepika/ophys_etl_pipelines:deepinterpolation_${CIRCLE_SHA1} alleninstitutepika/ophys_etl_pipelines:deepinterpolation_main_${CIRCLE_SHA1}
docker push alleninstitutepika/ophys_etl_pipelines:deepinterpolation_main_${CIRCLE_SHA1}
else
docker tag alleninstitutepika/ophys_etl_pipelines:${CIRCLE_SHA1} alleninstitutepika/ophys_etl_pipelines:develop_${CIRCLE_SHA1}
docker push alleninstitutepika/ophys_etl_pipelines:develop_${CIRCLE_SHA1}

build38:
docker tag alleninstitutepika/ophys_etl_pipelines:deepinterpolation_${CIRCLE_SHA1} alleninstitutepika/ophys_etl_pipelines:deepinterpolation_develop_${CIRCLE_SHA1}
docker push alleninstitutepika/ophys_etl_pipelines:deepinterpolation_develop_${CIRCLE_SHA1}
fi

jobs:
build_and_push:
machine:
image: ubuntu-2004:current
steps:
- build_and_test:
python_version: "3.8"
- when:
condition:
or:
- equal: [ main, << pipeline.git.branch >> ]
- matches:
pattern: "^/*.*dev.*/*$"
value: << pipeline.git.branch >>
steps:
- smoke_test_and_push


lint:
executor: python/default
Expand All @@ -98,16 +170,7 @@ jobs:
workflows:
main:
jobs:
- build377
- build38
- lint
- docker:
- build_and_push:
requires:
- build377
- build38
- lint
filters:
branches:
only:
- main
- /.*dev.*/
40 changes: 0 additions & 40 deletions .circleci/docker/Dockerfile

This file was deleted.

20 changes: 10 additions & 10 deletions .circleci/scripts/run_and_test.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
PYTEST_MARK=${1}
PYTHON_VERSION=${2}
ENV_SPECIFICATION=${3} # which conda environment to run in
ENV_SPECIFICATION=${3} # a name to use for coverage output file
OUTPUT_XML=${4} # the name of the coverage xml file (not its full path)
TEST_DIRECTORY=${5}
COVERAGE_EXE_PATH=${6} # path to coverage executable

echo "mark: "${PYTEST_MARK}
echo "version: "${PYTHON_VERSION}
echo "env: "${ENV_SPECIFICATION}
echo "xml: "${OUTPUT_XML}
echo "test directory": ${TEST_DIRECTORY}

set -e
export COVERAGE_FILE=/tmp/.coverage_${ENV_SPECIFICATION}_${PYTHON_VERSION}
echo "COVERAGE_FILE set to "${COVERAGE_FILE}
cd /repos/ophys_etl/
/envs/${ENV_SPECIFICATION}/bin/coverage run --rcfile .circleci/coveragerc_file --concurrency=multiprocessing -m \
pytest --verbose -s -m "${PYTEST_MARK}" \
tests
${COVERAGE_EXE_PATH} run --rcfile .circleci/coveragerc_file --concurrency=multiprocessing -m \
pytest --verbose \
-s -m "${PYTEST_MARK}" \
${TEST_DIRECTORY}

/envs/${ENV_SPECIFICATION}/bin/coverage combine --data-file=${COVERAGE_FILE} --rcfile .circleci/coveragerc_file
${COVERAGE_EXE_PATH} combine --data-file=${COVERAGE_FILE} --rcfile .circleci/coveragerc_file

# coverage automatically adds random salt to the end of the
# coverage file name; need to detect the name of the file
# that was actually produced
coverage_file_list=($(ls /tmp/.coverage_${ENV_SPECIFICATION}_${PYTHON_VERSION}*))
echo "after combining "
echo ${coverage_file_list[@]}

/envs/${ENV_SPECIFICATION}/bin/coverage xml --data-file=${COVERAGE_FILE} \
-o /coverage_outputs_${PYTHON_VERSION}/${OUTPUT_XML} \
--rcfile .circleci/coveragerc_file
echo ${coverage_file_list[@]}
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
extend-ignore = E203
extend-ignore = E203, E402
per-file-ignores =
src/ophys_etl/modules/event_detection/resources/event_decay_time_lookup.py:E501
Loading