-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #496 from ztqakita/master
[docs] add BrainPy docker and docs
- Loading branch information
Showing
5 changed files
with
137 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Docker | ||
|
||
on: | ||
release: | ||
types: [published] | ||
pull_request: | ||
paths: | ||
- docker/** | ||
- .github/workflows/docker.yml | ||
|
||
|
||
jobs: | ||
docker-build-push: | ||
if: | | ||
github.repository_owner == 'brainpy' || | ||
github.event_name != 'release' | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- context: "docker/" | ||
base: "brainpy/brainpy" | ||
env: | ||
TARGET_PLATFORMS: linux/amd64 | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
DOCKER_TAG_NAME: | | ||
${{ | ||
(github.event_name == 'release' && github.event.release.tag_name) || | ||
'pull-request-test' | ||
}} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Docker Build & Push (version tag) | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ matrix.context }} | ||
tags: ${{ matrix.base }}:${{ env.DOCKER_TAG_NAME }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
platforms: ${{ env.TARGET_PLATFORMS }} | ||
|
||
- name: Docker Build & Push (latest tag) | ||
if: | | ||
(github.event_name == 'release' && ! github.event.release.prerelease) | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ matrix.context }} | ||
tags: ${{ matrix.base }}:latest | ||
push: ${{ github.event_name != 'pull_request' }} | ||
platforms: ${{ env.TARGET_PLATFORMS }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ENV TZ=Asia/Dubai | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
RUN apt update | ||
RUN apt install -y --no-install-recommends software-properties-common | ||
|
||
RUN apt update && apt install -y python3-pip | ||
|
||
RUN ln -sf /usr/bin/python3.10 /usr/bin/python && \ | ||
ln -sf /usr/bin/pip3 /usr/bin/pip | ||
|
||
|
||
RUN pip --no-cache-dir install --upgrade pip && \ | ||
pip --no-cache-dir install --upgrade setuptools && \ | ||
pip --no-cache-dir install --upgrade wheel | ||
|
||
ADD . /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
||
RUN pip --no-cache-dir install --upgrade "jax[cpu]" | ||
RUN pip --no-cache-dir install --upgrade -r requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
numpy | ||
tqdm | ||
msgpack | ||
matplotlib>=3.4 | ||
jax | ||
jaxlib | ||
scipy>=1.1.0 | ||
brainpy | ||
brainpylib | ||
brainpy_datasets | ||
h5py | ||
pathos | ||
|
||
# test requirements | ||
pytest | ||
absl-py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters