diff --git a/.circleci/config.yml b/.circleci/config.yml index 75a82c6e..cbba3f39 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: checkout_code: docker: - - image: condaforge/mambaforge + - image: condaforge/miniforge3 working_directory: ~/repo steps: - checkout @@ -18,7 +18,7 @@ jobs: TIKTORCH_ENV_NAME: tiktorch-server-env TIKTORCH_ENV_PREFIX: /opt/conda/envs/tiktorch-server-env docker: - - image: condaforge/mambaforge + - image: condaforge/miniforge3 working_directory: ~/repo steps: - restore_cache: @@ -26,25 +26,21 @@ jobs: - v1-repo-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: keys: - - v11-dependencies-{{ checksum "environment.yml" }} - + - v11-dependencies-{{ .Environment.CIRCLE_SHA1 }} - run: conda config --set channel_priority strict - - run: mamba update -n base -c conda-forge --update-all - - run: mamba install -c conda-forge conda-build make boa + - run: conda update -n base -c conda-forge --update-all + - run: conda install -c conda-forge conda-build make boa - run: | - if [ ! -d ${TIKTORCH_ENV_PREFIX} ]; then echo "Creating new environment ${TIKTORCH_ENV_NAME}" make devenv - fi - - save_cache: paths: - /opt/conda/envs - key: v11-dependencies-{{ checksum "environment.yml" }} + key: v11-dependencies-{{ .Environment.CIRCLE_SHA1 }} pre_commit_check: docker: - - image: condaforge/mambaforge + - image: condaforge/miniforge3 working_directory: ~/repo steps: - restore_cache: @@ -52,7 +48,7 @@ jobs: - v1-repo-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: keys: - - v11-dependencies-{{ checksum "environment.yml" }} + - v11-dependencies-{{ .Environment.CIRCLE_SHA1 }} - run: name: run pre-commit @@ -63,7 +59,7 @@ jobs: tests: docker: - - image: condaforge/mambaforge + - image: condaforge/miniforge3 working_directory: ~/repo steps: - restore_cache: @@ -71,7 +67,7 @@ jobs: - v1-repo-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: keys: - - v11-dependencies-{{ checksum "environment.yml" }} + - v11-dependencies-{{ .Environment.CIRCLE_SHA1 }} - run: name: run tests @@ -83,15 +79,15 @@ jobs: build_conda_packages: docker: - - image: condaforge/mambaforge + - image: condaforge/miniforge3 working_directory: ~/repo steps: - restore_cache: keys: - v1-repo-{{ .Environment.CIRCLE_SHA1 }} - - run: mamba config --set channel_priority strict - - run: mamba install -c conda-forge conda-build anaconda-client boa + - run: conda config --set channel_priority strict + - run: conda install -c conda-forge conda-build anaconda-client boa - run: name: build packages command: | diff --git a/Makefile b/Makefile index f35813ed..d7e516d7 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,7 @@ SHELL=/bin/bash ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) TIKTORCH_ENV_NAME ?= tiktorch-server-env - -sample_model: - cd tests/data/dummy && zip -r $(ROOT_DIR)/dummy.tmodel ./* - -unet2d: - cd tests/data/unet2d && zip -r $(ROOT_DIR)/unet2d.tmodel ./* - -unet2d_onnx: - cd tests/data/unet2d_onnx && zip -r $(ROOT_DIR)/onnx.tmodel ./* - -dummy_tf: - cd tests/data/dummy_tensorflow && zip -r $(ROOT_DIR)/dummy_tf.tmodel ./* +SUBMODULES = ./vendor/core-bioimage-io-python ./vendor/spec-bioimage-io protos: python -m grpc_tools.protoc -I./proto --python_out=tiktorch/proto/ --grpc_python_out=tiktorch/proto/ ./proto/*.proto @@ -21,18 +10,23 @@ protos: version: python -c "import sys; print(sys.version)" - devenv: . $$(conda info --base)/etc/profile.d/conda.sh mamba env create --file environment.yml --name $(TIKTORCH_ENV_NAME) - conda run -n $(TIKTORCH_ENV_NAME) pip install . ./vendor/core-bioimage-io-python ./vendor/spec-bioimage-io + make install_submodules run_server: . $$(conda info --base)/etc/profile.d/conda.sh; conda activate $(TIKTORCH_ENV_NAME); python -m tiktorch.server +install_submodules: + @echo "Installing submodules $(SUBMODULES)" + @for package in $(SUBMODULES) ; do \ + echo $$package ; \ + conda run -n $(TIKTORCH_ENV_NAME) pip install -e $$package ; \ + done remove_devenv: conda env remove --yes --name $(TIKTORCH_ENV_NAME) -.PHONY: protos version sample_model devenv remove_devenv dummy_tf +.PHONY: *