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

PFHub CLI tool #1510

Draft
wants to merge 71 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1783f40
build(nix): add zip and unzip
wd15 Mar 27, 2023
212431f
build(nix): add jupyter to shell-surge.nix
wd15 Mar 27, 2023
498c6d7
notebooks: move upload.md and make a notebook
wd15 Mar 27, 2023
f48740a
feat: implement conversion of meta to zenodo
wd15 Mar 27, 2023
3dafd0f
data: templates for meta -> zenodo
wd15 Mar 27, 2023
8a9759b
refactor: make convert.py functional style
wd15 Mar 31, 2023
1d72e4a
add intermediate changes
wd15 Apr 10, 2023
41033ea
build(nix): switch to using flakes
wd15 Jul 7, 2023
b6f6271
style: clean for black and pylint
wd15 Jul 7, 2023
edca8f9
ci(github): update for nix flakes
wd15 Jul 7, 2023
cf543f5
ci(travis): remove travis ci altogether
wd15 Jul 7, 2023
a06fe2d
data: fix broken simulation schema
wd15 Jul 17, 2023
41db02c
docs: update for nix flakes and docker
wd15 Jul 20, 2023
d0e72d1
chore: remove unused apps
wd15 Jul 18, 2023
58233d1
build(nix): remove all old nix builds
wd15 Jul 7, 2023
4afbacb
chore: remove unused file
wd15 Jul 18, 2023
cb082b7
build(docker): now using flakes to build docker
wd15 Jul 20, 2023
412eb09
ci: add nix flake checker to tests
wd15 Aug 2, 2023
dddfef7
notebooks: update to work with flakes
wd15 Aug 4, 2023
6722168
Merge branch 'flakes' into upload-notebook
wd15 Aug 4, 2023
ed655f4
build(nix): bug fix
wd15 Aug 5, 2023
4a677fd
style: clean for linters
wd15 Aug 5, 2023
702c3cc
feat: add first version of command line tool
wd15 Aug 7, 2023
700b2c6
build(nix): add zenodo_client
wd15 Aug 7, 2023
686b508
build: dependencies for pip installed environment
wd15 Aug 7, 2023
6af3f20
docs: pypi release instructions
wd15 Aug 7, 2023
e2a641a
docs: move release docs into python-pfhub
wd15 Aug 7, 2023
f617241
build(nix): fix nix develop in base directory
wd15 Aug 8, 2023
87be2ff
tests: fix tests for older version of dotwiz
wd15 Aug 8, 2023
5e6a413
build(python): use correct file name for cli
wd15 Aug 8, 2023
e42b527
docs: remove duplicate release notes
wd15 Aug 8, 2023
ad224b1
tests: don't test coverage in versioneer files
wd15 Aug 8, 2023
14ce814
ci: test pfhub with conda
wd15 Aug 8, 2023
3032523
ci: debug
wd15 Aug 8, 2023
681a9d4
ci: debug
wd15 Aug 8, 2023
2710bbc
ci: debug
wd15 Aug 8, 2023
b6ee2e4
build(python): specify dotwiz version
wd15 Aug 8, 2023
ba2abce
build(nix): add click-params
wd15 Aug 10, 2023
d711c44
feat: download command for cli
wd15 Aug 10, 2023
a32ec94
build(python): add click-params
wd15 Aug 10, 2023
bc2ecb1
build(nix): include pykwalify
wd15 Aug 10, 2023
02850d4
feat: add convert-to-zenodo in cli
wd15 Aug 10, 2023
20f6be3
data: add meta.yaml schema for cli tool
wd15 Aug 11, 2023
e7b0cfe
feat: add convert-to-zenodo to cli tool
wd15 Aug 11, 2023
81e2969
build(python): add missing pykwalify package
wd15 Aug 11, 2023
c46e3a7
ci: add required packages
wd15 Aug 11, 2023
12b2680
feat: add option to run the tests to cli tool
wd15 Aug 11, 2023
d80f021
ci: run the cli tests outside of the working copy
wd15 Aug 11, 2023
be81e91
feat: include schema validation in cli
wd15 Aug 12, 2023
1efd13a
build(python): add linkml package
wd15 Aug 12, 2023
8be6ed6
data: add schemas and yaml data for checking
wd15 Aug 12, 2023
bd6f22a
build(nix): pip install linkml
wd15 Aug 12, 2023
304f00a
build(nix): add linkml as pip install for now
wd15 Aug 12, 2023
71923a6
fix: use correct path to yaml schema
wd15 Aug 12, 2023
e0e6491
data: add schema for pfhub yaml files
wd15 Aug 12, 2023
bb69614
build(nix): base flake.nix was failing on pylint
wd15 Aug 13, 2023
fae80b6
ci: trigger
wd15 Aug 13, 2023
3b569bc
ci: make _data/python-pfhub flake check first
wd15 Aug 13, 2023
fa807f7
build(nix): update flake.lock
wd15 Aug 13, 2023
ebfa64a
ci: remove duplicate nix installations
wd15 Aug 13, 2023
318b1c2
build(nix): stop pip checking versions
wd15 Aug 13, 2023
5b186e5
build(nix): trying to make nix work
wd15 Aug 13, 2023
98a78c0
ci: use nix develop in place of nix build
wd15 Aug 13, 2023
f7b6177
build(pip): pin greenlet
wd15 Aug 13, 2023
d682128
refactor: download gets records from PFHub only
wd15 Aug 14, 2023
7360050
feat: implement convert-to-old command
wd15 Aug 14, 2023
8d42617
data: implement convert-to-old command
wd15 Aug 14, 2023
9dc08fa
feat: implement convert-to-old command
wd15 Aug 14, 2023
8675e42
test: fix broken test
wd15 Aug 15, 2023
58381d5
style: add stub commands and improve docs
wd15 Aug 16, 2023
fef31e3
Fix data formatting
wd15 Oct 26, 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
36 changes: 36 additions & 0 deletions .github/workflows/flake-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Nix flake checker determines the health of the flake.lock files.
# See https://determinate.systems/posts/flake-checker for some
# explanation. This checks that the branches that are relied on for
# packages are maintained and have recent commits. If they aren't
# maintained then the checker will notify us and we can update the
# lock or flake files.
---
name: Test Flakes
on: [push, pull_request]
jobs:
test-flakes:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4

- name: Check Nix flake inputs (./_data/python-pfhub/flake.lock)
uses: DeterminateSystems/flake-checker-action@v5
with:
flake-lock-path: _data/python-pfhub/flake.lock
- name: Build Nix package
run: |
cd _data/python-pfhub
nix develop # shoud be nix build, but linkml needs work
cd $GITHUB_WORKSPACE

- name: Check Nix flake inputs (./flake.lock)
uses: DeterminateSystems/flake-checker-action@v5
- name: Build Nix package
run: |
nix flake lock --update-input pfhub
nix build
6 changes: 3 additions & 3 deletions .github/workflows/surge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
- run: echo "REPO=$(cat repo)" >> $GITHUB_ENV
- run: echo "HEAD_REF=$(cat head_ref)" >> $GITHUB_ENV

- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3
with:
repository: ${{ env.REPO }}
ref: ${{ env.HEAD_REF }}

- uses: cachix/install-nix-action@v14.1
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable

Expand All @@ -50,7 +50,7 @@ jobs:
SURGE_LOGIN: "${{ secrets.SURGE_LOGIN }}"
SURGE_TOKEN: "${{ secrets.SURGE_TOKEN }}"
run: |
nix-shell shell-surge.nix --command " \
nix develop --command bash -c " \
if [[ ${{ env.NAME }} == 'pullrequest' ]]; then \
rm -rf ./_site && \
jekyll build && \
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test-conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Test PFHub With Conda
on: [push, pull_request]
jobs:
pfhub-conda-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./_data/python-pfhub
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: test-env
create-args: >-
python=3.10
- run: python setup.py install
- run: py.test --nbval-lax --cov-fail-under=100
- run: |
mkdir -p tmp
cd tmp
pfhub test
35 changes: 35 additions & 0 deletions .github/workflows/test-jekyll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Test Jekyll
on: [push, pull_request]
jobs:
pfhub-nix-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
name: pfhub
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
extraPullNames: nix-community
- run: echo "UID=${UID}" >> $GITHUB_ENV
- uses: actions/cache/restore@v3
with:
path: /run/user/${{ env.UID }}/http_cache.sqlite
key: ${{ runner.os}}-http_cache.sqlite
# Following required because of
# https://github.com/NixOS/nix/issues/3978#issuecomment-1585001299
- run: nix flake lock --update-input pfhub
- run: nix develop --command bash -c "make simulations"
- run: nix develop --command bash -c "find . -name '*.ipynb' -type f -not -path '*/.ipynb_checkpoints/*' -exec touch {} \;"
- run: nix develop --command bash -c "make notebooks"
- run: nix develop --command bash -c "rm -rf ./_site"
- run: nix develop --command bash -c "jekyll build -d ./_site/pfhub"
- uses: actions/cache/save@v3
if: always()
with:
path: /run/user/${{ env.UID }}/http_cache.sqlite
key: ${{ runner.os}}-http_cache.sqlite
16 changes: 8 additions & 8 deletions .github/workflows/test-pfhub-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
run:
working-directory: ./_data/python-pfhub
steps:
- uses: actions/checkout@v2.3.4
- uses: cachix/install-nix-action@v14.1
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
name: pfhub
Expand All @@ -20,12 +20,12 @@ jobs:
with:
path: /run/user/${{ env.UID }}/http_cache.sqlite
key: ${{ runner.os}}-http_cache.sqlite
- run: nix-shell --pure --command "py.test --nbval-lax --cov-fail-under=100"
- run: nix-shell --pure --command "black --check setup.py pfhub"
- run: nix-shell --pure --command "pylint setup.py pfhub"
- run: nix-shell --pure --command "flake8 setup.py pfhub"
- run: nix-shell --pure --command "cd ../../results; make notebooks"
- run: nix-shell --pure --command "py.test --nbval-lax ../../results/benchmark*.ipynb"
- run: nix develop --command bash -c "py.test --nbval-lax --cov-fail-under=100"
- run: nix develop --command bash -c "black --check setup.py pfhub"
- run: nix develop --command bash -c "pylint setup.py pfhub"
- run: nix develop --command bash -c "flake8 setup.py pfhub"
- run: nix develop --command bash -c "cd ../../results; make notebooks"
- run: nix develop --command bash -c "py.test --nbval-lax ../../results/benchmark*.ipynb"
- uses: actions/cache/save@v3
if: always()
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ benchmarks/.ipynb_checkpoints
results/template.ipynb.md
results/template.ipynb.raw.html
results/*.ipynb
_data/python-pfhub/dist
_data/python-pfhub/build
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

25 changes: 18 additions & 7 deletions DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,32 @@ Pull the Docker Instance from Dockerhub

Run the container

$ docker run -i -t -p 4000:4000 wd15/pfhub:latest
$ docker run -i -t -p 8888:8888 wd15/pfhub:latest

and then
### View the notebooks

# nix-shell
# cd pfhub
# jekyll serve --host 0.0.0.0
# jupyter-notebook --ip 0.0.0.0 --no-browser

to view the website at http://127.0.0.1:4000/pfhub/ on the host.
and view the running Jupyter file browser at http://127.0.0.1:8888 on
the host.

### View the website

# cd pfhub
# jekyll serve --host 0.0.0.0 --port 8888

to view the website at http://127.0.0.1:8888/pfhub/ on the host.

## Build the Docker instance

Clone this repository and run
The Docker instance is built using Nix. See (./NIX.md) to get started.
Once you're familiar with Nix, clone this repository and then

$ nix build .#docker
$ docker load < result

$ docker build -t wd15/pfhub:latest .
in the base directory.

## Push the Docker instance

Expand Down
57 changes: 0 additions & 57 deletions Dockerfile

This file was deleted.

Loading
Loading