Skip to content

Commit 1f24a44

Browse files
authored
Merge pull request #95 from guzman-raphael/fix-docs-asset
Fix docs asset upload issue
2 parents 9afcf24 + 72a168a commit 1f24a44

File tree

7 files changed

+137
-85
lines changed

7 files changed

+137
-85
lines changed
File renamed without changes.

.github/workflows/development.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@ jobs:
193193
asset_path: ${{env.PHARUS_SDIST_PATH}}
194194
asset_name: pip-pharus-${{env.PHARUS_VERSION}}.tar.gz
195195
asset_content_type: application/gzip
196+
- name: Upload deploy docker environment
197+
uses: actions/upload-release-asset@v1
198+
env:
199+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
200+
with:
201+
upload_url: ${{steps.create_gh_release.outputs.upload_url}}
202+
asset_path: docker-compose-deploy.yaml
203+
asset_name: docker-compose-deploy.yaml
204+
asset_content_type: application/yaml
196205
publish-images:
197206
if: github.event_name == 'push'
198207
needs: publish-release
@@ -287,7 +296,7 @@ jobs:
287296
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
288297
with:
289298
upload_url: ${{needs.publish-release.outputs.release_upload_url}}
290-
asset_path: docs-static-pharus-${PHARUS_VERSION}.zip
291-
asset_name: docs-static-pharus-${PHARUS_VERSION}.zip
299+
asset_path: "docs-static-pharus-${{env.PHARUS_VERSION}}.zip"
300+
asset_name: "docs-static-pharus-${{env.PHARUS_VERSION}}.zip"
292301
asset_content_type: application/zip
293302
# fail_on_unmatched_files: true

CHANGELOG.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
44

5-
## [0.1.0b1] - 2021-03-11
5+
## [0.1.0b2] - 2021-03-12
66

77
### Fixed
88
- Fixed behavior where using list_table with a nonexistent schema_name creates it instead of returning an error message (#65) PR #63
99

1010
### Changed
11-
- Contribution policy to follow directly the general DataJoint Contribution Guideline. (#91) PR #94
11+
- Contribution policy to follow directly the general DataJoint Contribution Guideline. (#91) PR #94, #95
1212

1313
### Added
14-
- Issue templates for bug reports and enhancement requests. PR #94
15-
- Docker environment for documentation build. (#92) PR #94
16-
- Add Sphinx-based documentation source and fix parsing issues. (#92) PR #94
17-
- GitHub Actions automation that publishes on release new docs to release and GitHub Pages. (#92) PR #94
14+
- Issue templates for bug reports and enhancement requests. PR #94, #95
15+
- Docker environment for documentation build. (#92) PR #94, #95
16+
- Add Sphinx-based documentation source and fix parsing issues. (#92) PR #94, #95
17+
- GitHub Actions automation that publishes on release new docs to release and GitHub Pages. (#92) PR #94, #95
1818

1919
## [0.1.0b0] - 2021-02-26
2020

@@ -50,6 +50,6 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
5050
- Support for DataJoint attribute types: `varchar`, `int`, `float`, `datetime`, `date`, `time`, `decimal`, `uuid`.
5151
- Check dependency utility to determine child table references.
5252

53-
[0.1.0b1]: https://github.com/datajoint/pharus/compare/0.1.0b0...0.1.0b1
53+
[0.1.0b2]: https://github.com/datajoint/pharus/compare/0.1.0b0...0.1.0b2
5454
[0.1.0b0]: https://github.com/datajoint/pharus/compare/0.1.0a5...0.1.0b0
5555
[0.1.0a5]: https://github.com/datajoint/pharus/releases/tag/0.1.0a5

README.rst

Lines changed: 21 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5,100 +5,49 @@ User Documentation
55

66
The Pharus project is still early in its life and the maintainers are currently actively developing with a priority of addressing first critical issues directly related to the deliveries of `Alpha <https://github.com/datajoint/pharus/milestone/1>`_ and `Beta <https://github.com/datajoint/pharus/milestone/2>`_ milestones. Please be advised that while working through our milestones, we may restructure/refactor the codebase without warning until we issue our `Official Release <https://github.com/datajoint/pharus/milestone/3>`_ currently planned as ``0.1.0`` on ``2021-03-31``.
77

8-
``pharus`` is a generic REST API server backend for DataJoint pipelines built on top of ``flask``, ``datajoint``, and ``pyjwt``.
8+
``pharus`` is a generic REST API server backend for `DataJoint <https://datajoint.io>`_ pipelines built on top of ``flask``, ``datajoint``, and ``pyjwt``.
99

1010
- `Documentation <https://datajoint.github.io/pharus>`_
11-
- `Package <https://pypi.org/project/pharus/>`_
11+
- `PyPi Package <https://pypi.org/project/pharus/>`_
12+
- `Docker Image <https://hub.docker.com/r/datajoint/pharus>`_
13+
- `Release <https://github.com/datajoint/pharus/releases/latest>`_
1214
- `Source <https://github.com/datajoint/pharus>`_
1315

14-
Requirements for Preferred Setup
15-
--------------------------------
16+
Installation
17+
------------
18+
19+
If you have not done so already, please install the following dependencies.
1620

1721
- `Docker <https://docs.docker.com/get-docker/>`_
1822
- `Docker Compose <https://docs.docker.com/compose/install/>`_
1923

20-
Run Locally w/ Docker
21-
---------------------
22-
23-
- Copy a ``*-docker-compose.yaml`` file corresponding to your usage to ``docker-compose.yaml``. This file is untracked so feel free to modify as necessary. Idea is to commit anything generic but system/setup dependent should go on 'your' version i.e. local UID/GID, etc.
24-
- Check the first comment which will provide the best instruction on how to start the service; yes, it is a bit long. Note: Any of the keyword arguments prepended to the ``docker-compose`` command can be safely moved into a dedicated ``.env`` and read automatically if they are not evaluated i.e. ``$(...)``. Below is a brief description of the non-evaluated environment variables:
25-
26-
.. code-block:: bash
27-
28-
PY_VER=3.8 # Python version: 3.6|3.7|3.8
29-
IMAGE=djtest # Image type: djbase|djtest|djlab|djlabhub
30-
DISTRO=alpine # Distribution: alpine|debian
31-
AS_SCRIPT= # If 'TRUE', will not keep container alive but run tests and exit
32-
33-
.. note::
34-
35-
Deployment options currently being considered are `Docker Compose <https://docs.docker.com/compose/install/>`_ and `Kubernetes <https://kubernetes.io/docs/tutorials/kubernetes-basics/>`_.
36-
37-
Run Locally w/ Python
38-
---------------------
39-
40-
- Set environment variables for port assignment (``PHARUS_PORT``, defaults to 5000) and API route prefix (``PHARUS_PREFIX`` e.g. ``/api``, defaults to empty string).
41-
- For development, use CLI command ``pharus``. This method supports hot-reloading so probably best coupled with ``pip install -e ...``.
42-
- For production, use ``gunicorn --bind 0.0.0.0:${PHARUS_PORT} pharus.server:app``.
43-
44-
Run Tests for Development w/ Pytest and Flake8
45-
----------------------------------------------
46-
47-
- Set ``pharus`` testing environment variables:
48-
49-
.. code-block:: bash
50-
51-
PKG_DIR=/opt/conda/lib/python3.8/site-packages/pharus # path to pharus installation
52-
TEST_DB_SERVER=example.com:3306 # testing db server address
53-
TEST_DB_USER=root # testing db server user (needs DDL privilege)
54-
TEST_DB_PASS=unsecure # testing db server password
55-
56-
- For syntax tests, run ``flake8 ${PKG_DIR} --count --select=E9,F63,F7,F82 --show-source --statistics``
57-
- For pytest integration tests, run ``pytest -sv --cov-report term-missing --cov=${PKG_DIR} /main/tests``
58-
- For style tests, run ``flake8 ${PKG_DIR} --count --max-complexity=20 --max-line-length=95 --statistics``
24+
Prerequisites
25+
-------------
5926

60-
Creating Sphinx Documentation from Scratch
61-
------------------------------------------
27+
Download the ``docker-compose-deploy.yaml`` docker environment from the source located `here <https://github.com/datajoint/pharus/releases/latest/download/docker-compose-deploy.yaml>`_.
6228

63-
Recommend the follow to be ran within the ``pharus`` container in ``docs`` Docker Compose environment.
29+
Running the API server
30+
----------------------
6431

65-
- Run the following commands and complete the prompts as requested.
32+
To start the API server, use the command:
6633

6734
.. code-block:: bash
6835
69-
mkdir docs
70-
cd docs
71-
sphinx-quickstart
72-
73-
- In ``docs/conf.py`` add to the beginning:
74-
75-
.. code-block:: python
36+
PHARUS_VERSION=0.1.0b2 docker-compose -f docker-compose-deploy.yaml up -d
7637
77-
import os
78-
import sys
79-
sys.path.insert(0, os.path.abspath('..'))
80-
81-
- In ``docs/conf.py:extensions`` append ``['sphinx.ext.autodoc', 'sphinxcontrib.httpdomain']``. See ``requirements_docs.txt`` and ``docker-compose-docs.yaml`` for details on documentation dependencies.
82-
- Run the following to automatically generate the API docs:
38+
To stop the API server, use the command:
8339

8440
.. code-block:: bash
8541
86-
sphinx-apidoc -o . .. ../tests/* ../setup.py
87-
88-
- Add ``modules`` within the ``toctree`` directive in ``index.rst``.
89-
- Build the docs by running:
90-
91-
.. code-block:: bash
92-
93-
make html
42+
PHARUS_VERSION=0.1.0b2 docker-compose -f docker-compose-deploy.yaml down
9443
9544
References
9645
----------
9746

47+
- DataJoint
48+
49+
- https://datajoint.io
50+
9851
- DataJoint LabBook (a companion frontend)
9952

10053
- https://github.com/datajoint/datajoint-labbook
101-
102-
- Python Tutorial for Flask, Swagger, and Automated docs
103-
104-
- https://realpython.com/flask-connexion-rest-api/#reader-comments

docker-compose-deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# PHARUS_VERSION=0.1.0b1 docker-compose -f docker-compose-deploy.yaml pull
2-
# PHARUS_VERSION=0.1.0b1 docker-compose -f docker-compose-deploy.yaml up -d
1+
# PHARUS_VERSION=0.1.0b2 docker-compose -f docker-compose-deploy.yaml pull
2+
# PHARUS_VERSION=0.1.0b2 docker-compose -f docker-compose-deploy.yaml up -d
33
#
44
# Intended for production deployment.
55
# Note: You must run both commands above for minimal outage

docs/dev_notes.rst

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,98 @@
11
General Notes
22
=============
33

4-
Dev docs TBD.
4+
Requirements for Preferred Setup
5+
--------------------------------
6+
7+
- `Docker <https://docs.docker.com/get-docker/>`_
8+
- `Docker Compose <https://docs.docker.com/compose/install/>`_
9+
10+
Run Locally w/ Docker
11+
---------------------
12+
13+
- Copy the docker environment (i.e. ``*-docker-compose.yaml``) of your choice corresponding to your usage to ``docker-compose.yaml``. This file is untracked so feel free to modify as necessary. Idea is to commit anything generic but system/setup dependent should go on 'your' version i.e. local UID/GID, etc.
14+
- Check the first header comment which will provide the best instruction on how to start the service; yes, it is a bit long. Note: Any of the keyword arguments prepended to the ``docker-compose`` command can be safely moved into a dedicated ``.env`` and read automatically if they are not evaluated i.e. ``$(...)``. Below is a brief description of the non-evaluated environment variables:
15+
16+
.. code-block:: bash
17+
18+
PY_VER=3.8 # Python version: 3.6|3.7|3.8
19+
IMAGE=djtest # Image type: djbase|djtest|djlab|djlabhub
20+
DISTRO=alpine # Distribution: alpine|debian
21+
AS_SCRIPT= # If 'TRUE', will not keep container alive but run tests and exit
22+
23+
.. note::
24+
25+
Deployment options currently being considered are `Docker Compose <https://docs.docker.com/compose/install/>`_ and `Kubernetes <https://kubernetes.io/docs/tutorials/kubernetes-basics/>`_.
26+
27+
Run Locally w/ Python
28+
---------------------
29+
30+
- Set environment variables for port assignment (``PHARUS_PORT``, defaults to 5000) and API route prefix (``PHARUS_PREFIX`` e.g. ``/api``, defaults to empty string).
31+
- For development, use CLI command ``pharus``. This method supports hot-reloading so probably best coupled with ``pip install -e ...``.
32+
- For production, use ``gunicorn --bind 0.0.0.0:${PHARUS_PORT} pharus.server:app``.
33+
34+
Run Tests for Development w/ Pytest and Flake8
35+
----------------------------------------------
36+
37+
- Set ``pharus`` testing environment variables:
38+
39+
.. code-block:: bash
40+
41+
PKG_DIR=/opt/conda/lib/python3.8/site-packages/pharus # path to pharus installation
42+
TEST_DB_SERVER=example.com:3306 # testing db server address
43+
TEST_DB_USER=root # testing db server user (needs DDL privilege)
44+
TEST_DB_PASS=unsecure # testing db server password
45+
46+
- For syntax tests, run ``flake8 ${PKG_DIR} --count --select=E9,F63,F7,F82 --show-source --statistics``
47+
- For pytest integration tests, run ``pytest -sv --cov-report term-missing --cov=${PKG_DIR} /main/tests``
48+
- For style tests, run ``flake8 ${PKG_DIR} --count --max-complexity=20 --max-line-length=95 --statistics``
49+
50+
Creating Sphinx Documentation from Scratch
51+
------------------------------------------
52+
53+
Recommend the follow to be ran within the ``pharus`` container in ``docs`` Docker Compose environment.
54+
55+
- Run the following commands and complete the prompts as requested.
56+
57+
.. code-block:: bash
58+
59+
mkdir docs
60+
cd docs
61+
sphinx-quickstart
62+
63+
- In ``docs/conf.py`` add to the beginning:
64+
65+
.. code-block:: python
66+
67+
import os
68+
import sys
69+
sys.path.insert(0, os.path.abspath('..'))
70+
71+
- In ``docs/conf.py:extensions`` append ``['sphinx.ext.autodoc', 'sphinxcontrib.httpdomain']``. See ``requirements_docs.txt`` and ``docker-compose-docs.yaml`` for details on documentation dependencies.
72+
- Run the following to automatically generate the API docs:
73+
74+
.. code-block:: bash
75+
76+
sphinx-apidoc -o . .. ../tests/* ../setup.py
77+
78+
- Add ``modules`` within the ``toctree`` directive in ``index.rst``.
79+
- Build the docs by running:
80+
81+
.. code-block:: bash
82+
83+
make html
84+
85+
References
86+
----------
87+
88+
- DataJoint
89+
90+
- https://datajoint.io
91+
92+
- DataJoint LabBook (a companion frontend)
93+
94+
- https://github.com/datajoint/datajoint-labbook
95+
96+
- Python Tutorial for Flask, Swagger, and Automated docs
97+
98+
- https://realpython.com/flask-connexion-rest-api/#reader-comments

pharus/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""Package metadata."""
2-
__version__ = '0.1.0b1'
2+
__version__ = '0.1.0b2'

0 commit comments

Comments
 (0)