Skip to content

Commit

Permalink
Merge branch 'ahand-auth' of https://github.com/usnistgov/dioptra int…
Browse files Browse the repository at this point in the history
…o ahand-auth
  • Loading branch information
andrewhand committed Oct 10, 2023
2 parents 84a8b28 + eeb0517 commit eb088e1
Show file tree
Hide file tree
Showing 126 changed files with 8,042 additions and 3,273 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ jobs:
- tensorflow2-gpu

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/remove-extra-software

- name: set docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
${{ env.PROJECT_PREFIX }}/${{ matrix.dioptra-app }}
Expand All @@ -77,13 +77,13 @@ jobs:
org.opencontainers.image.authors=NCCoE Artificial Intelligence Team <[email protected]>, James Glasbrenner <[email protected]>, Cory Miniter <[email protected]>, Howard Huang <[email protected]>, Julian Sexton <[email protected]>, Paul Rowe <[email protected]>
- name: set up docker qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: set up docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
target: final
Expand Down Expand Up @@ -120,10 +120,10 @@ jobs:
- mlflow-tracking

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup python 3.9
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.9"

Expand All @@ -137,7 +137,7 @@ jobs:
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: cache dependencies
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/tox.ini') }}
Expand All @@ -154,10 +154,10 @@ jobs:
path: /tmp

- name: set up docker qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: set up docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: load the container image
run: |
Expand All @@ -180,10 +180,10 @@ jobs:
- integration-tf-mnist-classifier

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup python 3.9
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.9"

Expand All @@ -197,7 +197,7 @@ jobs:
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: cache dependencies
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/tox.ini') }}
Expand All @@ -208,10 +208,10 @@ jobs:
run: python3 -m pip install tox

- name: set up docker qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: set up docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: download the nginx testing image
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:
- name: cache the mnist dataset download
if: ${{ matrix.tox-env != 'containers' }}
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: /tmp/dioptra-cache/mnist
key: ${{ runner.os }}-dioptra-cache-mnist
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/pip-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ name: pip-compile runs
on:
schedule:
- cron: "10 1 * * *" # at 1:10am every day
push:
branches:
- "**"

jobs:
pip-compile:
Expand All @@ -34,10 +37,10 @@ jobs:
- "requirements-dev-tensorflow"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup python ${{ matrix.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -58,7 +61,7 @@ jobs:

- name: cache dependencies
if: ${{ matrix.os != 'windows-latest' }}
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/tox.ini', 'requirements-dev*.in') }}
Expand All @@ -67,7 +70,7 @@ jobs:
- name: cache dependencies (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: ${{ steps.pip-cache-win.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/tox.ini', 'requirements-dev*.in') }}
Expand Down Expand Up @@ -129,10 +132,10 @@ jobs:
- "tensorflow2-gpu-requirements"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup python ${{ matrix.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -146,7 +149,7 @@ jobs:
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: cache dependencies
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/tox.ini', '**/requirements-dev*.in', '**/docker/pip-tools/*-requirements.in') }}
Expand Down Expand Up @@ -177,16 +180,16 @@ jobs:
- "py39-linux-aarch64-mlflow-tracking-requirements"
- "py39-linux-aarch64-restapi-requirements"
- "py39-linux-aarch64-pytorch-cpu-requirements"
# - "py39-linux-aarch64-tensorflow2-cpu-requirements"
- "py39-linux-aarch64-tensorflow2-cpu-requirements"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: set up docker qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: set up docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: setup dockerfile and output folder
run: |
Expand All @@ -200,7 +203,7 @@ jobs:
sudo chmod 0777 /image
- name: build and save to output folder
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sphinx-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
docs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup python 3.9
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: "3.9"

Expand All @@ -44,7 +44,7 @@ jobs:
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: cache dependencies
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/tox.ini') }}
Expand Down
34 changes: 26 additions & 8 deletions .github/workflows/tox-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
- "mypy"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup python ${{ matrix.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -54,7 +54,7 @@ jobs:
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: cache dependencies
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/tox.ini') }}
Expand All @@ -68,9 +68,10 @@ jobs:
run: python3 -m tox run -e ${{ matrix.tox-testenv }}

unit-tests:
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-20.04", "windows-latest"]
python-version: ["3.9", "3.10"]
tox-testenv:
- "clean,py39-pytest-cov,report"
Expand All @@ -88,13 +89,14 @@ jobs:
tox-testenv: "py39-cookiecutter"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: install English words dictionary
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: sudo apt install -y wamerican

- name: setup python ${{ matrix.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -104,19 +106,35 @@ jobs:
python3 -m pip install --upgrade pip
- name: get pip cache dir
if: ${{ matrix.os != 'windows-latest' }}
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: get pip cache dir (Windows)
if: ${{ matrix.os == 'windows-latest' }}
id: pip-cache-win
run: echo "dir=$(pip cache dir)" >> $env:GITHUB_OUTPUT

- name: cache dependencies
uses: actions/[email protected]
if: ${{ matrix.os != 'windows-latest' }}
uses: actions/[email protected]
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-
- name: cache dependencies (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/[email protected]
with:
path: ${{ steps.pip-cache-win.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-
- name: install dependencies
run: python3 -m pip install tox
run: python3 -m pip install --upgrade tox

- name: run tox
run: python3 -m tox run -e ${{ matrix.tox-testenv }}
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ PYTHON_VERSION_MINOR := $(word 2,$(subst ., ,$(PYTHON_VERSION)))
ARCH := $(strip $(shell /usr/bin/env $(PY) -c 'import platform; print(platform.machine().lower())'))

ifeq ($(ARCH),x86_64)
DETECTED_ARCH := x86_64
DETECTED_ARCH := amd64
else ifeq ($(ARCH),amd64)
DETECTED_ARCH := x86_64
DETECTED_ARCH := amd64
else ifeq ($(ARCH),aarch64)
DETECTED_ARCH := aarch64
DETECTED_ARCH := arm64
else ifeq ($(ARCH),arm64)
DETECTED_ARCH := aarch64
DETECTED_ARCH := arm64
endif

VENV_EXTRA ?=

ifeq ($(DETECTED_OS),Darwin)
CORES = $(shell sysctl -n hw.physicalcpu_max)
PIPTOOLS_SYNC := CFLAGS="-stdlib=libc++" pip-sync
VENV_REQUIREMENTS = requirements/macos-$(if $(filter aarch64, $(DETECTED_ARCH)),arm64,x86_64)-py$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)-requirements-dev$(VENV_EXTRA).txt
PIPTOOLS_SYNC := CFLAGS="-stdlib=libc++ -std=c99" pip-sync
VENV_REQUIREMENTS = requirements/macos-$(DETECTED_ARCH)-py$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)-requirements-dev$(VENV_EXTRA).txt
else ifeq ($(DETECTED_OS),Linux)
CORES = $(shell lscpu -p | egrep -v '^\#' | sort -u -t, -k 2,4 | wc -l)
PIPTOOLS_SYNC := pip-sync
Expand Down Expand Up @@ -181,7 +181,7 @@ DOCS_WEB_COMPILE_FILES := $(wildcard $(DOCS_SCSS_DIR)/*.scss)

PIP :=
ifeq ($(DETECTED_OS),Darwin)
PIP += CFLAGS="-stdlib=libc++" $(PY) -m pip
PIP += CFLAGS="-stdlib=libc++ -std=c99" $(PY) -m pip
else
PIP += $(PY) -m pip
endif
Expand Down
Loading

0 comments on commit eb088e1

Please sign in to comment.