Repository navigation
Python 3.9/3.11 support, dropping Python 3.6 support, and moving to GitHub Actions #559
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
Changes from all commits
79485f9
6e5fccb
791d70e
d278b19
1e19b8b
1e3db2a
ffe5c6e
c766514
3b6633e
c2fee22
8db3ac4
0f777cf
3739921
9643dc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: ci/github-actions | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ master, feature/** ] | ||
|
|
||
| push: | ||
| branches: [ master, feature/** ] | ||
|
|
||
|
|
||
| jobs: | ||
| run-light-tests: | ||
| env: | ||
| SKIP_LIMS: true | ||
| TEST_INHOUSE: false | ||
| ALLOW_TEST_DOWNLOADS: false | ||
| TEST_API_ENDPOINT: "http://api.brain-map.org" | ||
| IPFX_TEST_TIMEOUT: 60 | ||
|
|
||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.9", "3.11"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y hdf5-tools curl | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
| pip install allensdk | ||
| - name: Run tests | ||
| run: | | ||
| pip install -r requirements-test.txt | ||
| mkdir -p test-results | ||
| git lfs install | ||
| git config lfs.url 'https://github.com/AllenInstitute/ipfx.git/info/lfs' | ||
| git lfs env | ||
| git lfs pull | ||
| python -m pytest --junitxml=test-results/junit.xml --verbose | ||
|
|
||
|
|
||
| onprem-tests: | ||
| name: on-prem tests | ||
| runs-on: ["self-hosted"] | ||
| strategy: | ||
| matrix: | ||
| image: ["ipfx_py39:latest", "ipfx_py311:latest"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: run test in docker | ||
| run: | | ||
| docker run \ | ||
| --env-file ~/env.list \ | ||
| --mount type=bind,source=$PWD,target=/local1/github_worker,bind-propagation=rshared \ | ||
| -v /data/informatics/module_test_data/:/data/informatics/module_test_data/ \ | ||
| -v /allen/aibs/informatics/module_test_data/:/allen/aibs/informatics/module_test_data/ \ | ||
| -v /allen/programs/celltypes/production/mousecelltypes/:/allen/programs/celltypes/production/mousecelltypes/ \ | ||
| -v /allen/programs/celltypes/workgroups/279/:/allen/programs/celltypes/workgroups/279/ \ | ||
| -v /allen/programs/celltypes/production/humancelltypes/:/allen/programs/celltypes/production/humancelltypes/ \ | ||
| --workdir /local1/github_worker --rm \ | ||
| --user 1001:1001 \ | ||
| ${{ matrix.image }} \ | ||
| /bin/bash -c "python -m venv .venv; \ | ||
| source .venv/bin/activate; \ | ||
| pip install --upgrade pip; \ | ||
| pip install numpy; \ | ||
| pip install -r requirements.txt; \ | ||
| export TEST_API_ENDPOINT=http://api.brain-map.org; \ | ||
| export SKIP_LIMS=false; \ | ||
| export TEST_INHOUSE=true; \ | ||
| export ALLOW_TEST_DOWNLOADS=true; \ | ||
| export IPFX_TEST_TIMEOUT=60; \ | ||
| pip install -r requirements-test.txt; \ | ||
| git config lfs.url 'https://github.com/AllenInstitute/ipfx.git/info/lfs'; \ | ||
| git lfs env; \ | ||
| git lfs pull; \ | ||
| python -m pytest \ | ||
| --junitxml=test-reports/test.xml --verbose" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: IPFX Nightly onprem tests | ||
| on: | ||
| schedule: | ||
| - cron: '05 6 * * *' | ||
|
|
||
|
|
||
| jobs: | ||
| onprem: | ||
| name: on-prem tests | ||
| runs-on: ["self-hosted"] | ||
| strategy: | ||
| matrix: | ||
| image: ["ipfx_py39:latest", "ipfx_py311:latest"] | ||
| branch: ["master", "feature/**"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ matrix.branch }} | ||
| - name: run test in docker | ||
| run: | | ||
| docker run \ | ||
| --mount type=bind,source=$PWD,target=/local1/github_worker,bind-propagation=rshared \ | ||
| -v /data/informatics/module_test_data/:/data/informatics/module_test_data/ \ | ||
| -v /allen/aibs/informatics/module_test_data/:/allen/aibs/informatics/module_test_data/ \ | ||
| -v /allen/programs/celltypes/production/mousecelltypes/:/allen/programs/celltypes/production/mousecelltypes/ \ | ||
| -v /allen/programs/celltypes/workgroups/279/:/allen/programs/celltypes/workgroups/279/ \ | ||
| -v /allen/programs/celltypes/production/humancelltypes/:/allen/programs/celltypes/production/humancelltypes/ \ | ||
| --workdir /local1/github_worker --rm \ | ||
| --user 1001:1001 \ | ||
| ${{ matrix.image }} \ | ||
| /bin/bash -c "python -m venv .venv; \ | ||
| source .venv/bin/activate; \ | ||
| pip install --upgrade pip; \ | ||
| pip install numpy; \ | ||
| pip install -r requirements.txt; \ | ||
| export TEST_API_ENDPOINT=http://api.brain-map.org; \ | ||
| pip install -r requirements-test.txt; \ | ||
| git config lfs.url 'https://github.com/AllenInstitute/ipfx.git/info/lfs'; \ | ||
| git lfs env; \ | ||
| git lfs pull; \ | ||
| python -m pytest \ | ||
| --junitxml=test-reports/test.xml --verbose" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,3 +12,4 @@ Credits | |
| * Nile Graddis @nilegraddis | ||
| * Sergey Gratiy @sgratiy | ||
| * Yang Yu @gnayuy | ||
| * Sherif Soliman @sheriferson | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Docker images for on premise testing | ||
|
|
||
| This directory contains Dockerfiles for building images for running on-prem tests that require internal Allen Institute resources. On-prem tests use GitHub self-hosted runners that will run tests on docker images built from these Dockerfiles. | ||
|
|
||
| Our light and on-prem tests are defined in [our workflow file](../.github/workflows/github-actions-ci.yml "Link to GitHub Actions workflow for light and on-prem tests"). | ||
|
|
||
| - See [here](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners) for more information on self-hosted runners. | ||
| - See [here](https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners) for more information on adding self-hosted runners to a GitHub repository. | ||
|
|
||
| ## Building images | ||
|
|
||
| If you are an Allen Institute developer, you will have instructions on how to access the machine running the IPFX self-hosted runner. | ||
|
|
||
| On this machine you can create the Docker image corresponding to the Python versions we test on by running: | ||
|
|
||
| ``` | ||
| cd ipfx/docker/py39 | ||
| docker build -t ipfx_py39:latest . | ||
| ``` | ||
|
|
||
| And this should be sufficient for the on-prem tests defined in our GitHub workflow to run. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| FROM python:3.11 | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y \ | ||
| hdf5-tools \ | ||
| curl \ | ||
| git-lfs \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN curl https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| FROM python:3.6 | ||
| FROM python:3.9 | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y \ | ||
| hdf5-tools \ | ||
| curl | ||
| curl \ | ||
| git-lfs \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN curl https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash | ||
|
|
||
| RUN apt-get install git-lfs | ||
| RUN curl https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,7 +92,6 @@ def _commit_nwb_changes(self): | |
| recorded until _reload_nwbfile | ||
| """ | ||
|
|
||
| set_container_sources(self.nwbfile, self._h5_file.filename) | ||
| self.nwbfile.set_modified(True) | ||
| # Because the NWB schema versions of NWB data produced by MIES are older | ||
| # we do not want to cache the newer schema versions that IPFX is currently using | ||
|
|
@@ -236,36 +235,3 @@ def serialize(self, targets: Optional[OneOrMany[Dict[str, Any]]] = None): | |
| file_.write(self._data.getvalue()) | ||
|
|
||
| self._reload_nwbfile() | ||
|
|
||
|
|
||
| def set_container_sources( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to invoke Chesterton's Fence here and ask for an explanation of what this existing code does? Why is it safe to remove this now but not previously?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with the invocation. |
||
| container: hdmf.container.AbstractContainer, | ||
| source: str | ||
| ): | ||
| """Traverse an NWBFile starting at a given container, setting the | ||
| container_source attribute inplace on each container. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| container : container_source will be set on this object as well as on | ||
| each of its applicable children. | ||
| source : The new value of container source | ||
| """ | ||
| children = [container] | ||
| while children: | ||
| current = children.pop() | ||
|
|
||
| # 💀💀💀 | ||
| # container_source is set on write, but cannot be overrwritten, making | ||
| # read -> modify -> write elsewhere | ||
| # pretty tricky! | ||
| # this is a fragile workaround | ||
| if hasattr(current, "_AbstractContainer__container_source"): | ||
| setattr( | ||
| current, | ||
| "_AbstractContainer__container_source", | ||
| source | ||
| ) | ||
|
|
||
| if hasattr(current, "children"): | ||
| children.extend(current.children) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 1.0.8 | ||
| 2.0.0 |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should have this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you want to know if the actual |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,18 @@ | ||
| argschema<2.0.0 | ||
| allensdk | ||
| argschema | ||
| dictdiffer | ||
| h5py==2.10.0 | ||
| marshmallow==3.0.0rc6 | ||
| matplotlib>=1.4.3 | ||
| h5py | ||
| marshmallow | ||
| matplotlib | ||
| methodtools | ||
| numpy>=1.15.4,<1.19.0 | ||
| pandas>=0.25.1,<=0.25.3 | ||
| numpy | ||
| pandas | ||
| pg8000 | ||
| pillow | ||
| pyabf<2.3.0 | ||
| pynwb>=1.3.2,<2.0.0 | ||
| pyYAML<6.0.0 | ||
| scipy>=0.15.1 | ||
| simplejson>=3.10.0 | ||
| pyabf | ||
| pynwb==2.2.0 | ||
|
njmei marked this conversation as resolved.
|
||
| pyYAML | ||
| ruamel.yaml<0.18.0 | ||
| scipy | ||
| simplejson | ||
| watchdog | ||
Uh oh!
There was an error while loading. Please reload this page.