Skip to content

Commit b8e7cc1

Browse files
authored
Is245/rest features (ITISFoundation#2)
Updated features from latest versions of osparc-simcore services - new files skeleton - added ``extra`` folder with code parts to integrate in osparc-simcore (e.g. api/specs or docker-compose) - local makefile, bumpversion, and license - cli - REST API subsystem - Dockerfile closes to ITISFoundation/osparc-simcore#245
1 parent 251df4d commit b8e7cc1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2221
-521
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Order is important. The last matching pattern has the most precedence.
2+
3+
# files and folders recursively
4+
/ @pcrespov
5+
6+
# any change in travis
7+
/.travis.yml @sanderegg

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Long story short
2+
3+
<!-- Please describe your problem and why the fix is important. -->
4+
5+
## Expected behaviour
6+
7+
<!-- What is the behaviour you expect? -->
8+
9+
## Actual behaviour
10+
11+
<!-- What's actually happening? -->
12+
13+
## Steps to reproduce
14+
15+
<!-- Please describe steps to reproduce the issue.
16+
If you have a script that does that please include it here within
17+
markdown code markup -->
18+
19+
## Your environment
20+
21+
<!-- Describe the environment you have that lead to your issue.
22+
This includes aiohttp version, OS, proxy server and other bits that
23+
are related to your case.
24+
25+
IMPORTANT: aiohttp is both server framework and client library.
26+
For getting rid of confusing please put 'server', 'client' or 'both'
27+
word here.
28+
-->
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea to implement in the simcore plaform
4+
5+
---
6+
7+
**USER STORY:**
8+
9+
A clear and concise description of how the feature works and looks like from the user's perspective.
10+
11+
Ex. I want to be able the stop the running pipeline by pressing a stop button. If the pipeline is stopped, I see a info-level message confirming it in the logger, if it fails the message should be displayed in red (error). Also, all the progress bars in the nodes must be set to 0.
12+
13+
**DEFINITION OF DONE:**
14+
15+
A clear and concise description of what the feature requires.
16+
17+
0. Play button turns into stop button when pipeline is running
18+
1. Stop button turns into play button when pipeline is finished
19+
2. Stop button turns into play button when pipeline is successfully stopped
20+
3. Logger displays messages everytime the play/stop button is pressed
21+
4. Progress bars are set to 0 when stopping pipeline
22+
5. Stop button has a Python interface
23+
24+
**EXAMPLE:**
25+
26+
Any file/screenshot/photomontage/video/website is provided for a better understanding of the request

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!-- Thank you for your contribution!
2+
3+
- Add **WIP-** prefix in title if it is still work in progress (i.e. should not be merged but is ready to start reviewing it)
4+
- Use [waffle.io] keywords in title/descriptions to trigger bot actions:
5+
- close, closes, close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved #[issueNumber]
6+
- connect to, connects to, connected to, connect, connects, connected #[issueNumber]
7+
- parent of, parent to, parent #[issueNumber]
8+
- child of, child to, child #[issueNumber]
9+
- blocks, block, required by, needed by, dependency of #[issueNumber]
10+
- blocked by, required, require, needs, need, depends on #[issueNumber]
11+
-->
12+
13+
## What do these changes do?
14+
15+
<!-- Please give a short brief about these changes. -->
16+
17+
18+
## Related issue number
19+
20+
<!-- Are there any issues opened that will be resolved by merging this change?
21+
22+
- add mentions of the user or team responsible for reviewing proposed changes
23+
- and user/team to .github/CODEOWNERS to automatically assign reviewers
24+
-->
25+
26+
## Checklist
27+
28+
- [ ] I think the code is well written
29+
- [ ] Unit tests for the changes exist
30+
- [ ] Documentation reflects the changes
31+
- [ ] If you design a new module, add your user to .github/CODEOWNERS
32+
33+
[waffle.io]:https://waffle.io/marketing-assets/documents/waffleio_cheatsheet_v1.pdf?utm_source=blog&utm_medium=cheatsheet-ctabutton&utm_campaign=cheatsheet

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,10 @@ out/
121121
# temporary folders
122122
tmp/
123123

124-
# explicit mark
124+
125+
# explicit mark
125126
*ignore*
127+
.tmp*
128+
129+
# vscode configuration
130+
.vscode

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ addons:
66
- "python3-pip"
77
python:
88
- "3.6"
9-
install:
9+
install:
1010
- "pip install --upgrade pip wheel setuptools"
11-
- "pip install -r requirements-dev.txt"
12-
script: pytest
11+
- "pip install -r requirements.txt"
12+
13+
script: pytest -s -c pytest.ini

.vscode-template/settings.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"editor.tabSize": 2,
3+
"editor.insertSpaces": true,
4+
"editor.detectIndentation": false,
5+
"eslint.alwaysShowStatus": true,
6+
"files.associations": {
7+
".*rc": "ini",
8+
".env*": "ini",
9+
"Dockerfile*": "dockerfile",
10+
"**/requirements/*.txt": "pip-requirements",
11+
"**/requirements/*.in": "pip-requirements"
12+
},
13+
"files.eol": "\n",
14+
"files.insertFinalNewline": true,
15+
"files.trimFinalNewlines": true,
16+
"files.trimTrailingWhitespace": true,
17+
"python.formatting.autopep8Args": [
18+
"--max-line-length 140"
19+
],
20+
"python.linting.pylintEnabled": true,
21+
"python.linting.enabled": true,
22+
"[python]": {
23+
"editor.detectIndentation": false,
24+
"editor.tabSize": 4
25+
},
26+
"[makefile]": {
27+
"editor.insertSpaces": false
28+
},
29+
"python.unitTest.pyTestArgs": [
30+
"services/web/server"
31+
],
32+
"python.unitTest.unittestEnabled": false,
33+
"python.unitTest.nosetestsEnabled": false,
34+
"python.unitTest.pyTestEnabled": true,
35+
"python.pythonPath": ".venv/bin/python",
36+
"restructuredtext.confPath": "",
37+
"autoDocstring.docstringFormat": "sphinx"
38+
}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
TODO: check towncrier for release notes
6+
57
### [Unreleased][unreleased]
68

79
#### Added

Makefile

Lines changed: 83 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,55 +5,110 @@ SHELL = /bin/bash
55

66
.SUFFIXES:
77

8-
# Python virtual environment
9-
VENV_DIR = $(CURDIR)/venv
8+
VENV_DIR = $(CURDIR)/.venv
109
OUTPUT_DIR = $(CURDIR)/output
1110
TEMPLATE = $(CURDIR)
1211

13-
.PHONY: clean
14-
clean:
15-
@find "$(CURDIR)" \
16-
-name "*.py[cod]" -exec rm -fv {} + -o \
17-
-name __pycache__ -exec rm -rfv {} +
18-
@rm -rfv \
19-
"$(CURDIR)/.cache" \
20-
"$(CURDIR)/.mypy_cache" \
21-
"$(CURDIR)/.pytest_cache"
22-
@rm -rf "$(VENV_DIR)"
23-
@rm -rf "$(OUTPUT_DIR)"
12+
## Tools
13+
tools =
14+
15+
ifeq ($(shell uname -s),Darwin)
16+
SED = gsed
17+
else
18+
SED = sed
19+
endif
2420

21+
ifeq ($(shell which ${SED}),)
22+
tools += $(SED)
23+
endif
24+
25+
26+
## -------------------------------
27+
# All.
28+
29+
all: help
30+
ifdef tools
31+
$(error "Can't find tools:${tools}")
32+
endif
33+
34+
35+
#-----------------------------------
2536
.PHONY: install
37+
# target: install – installs all tooling to run and test current cookie-cutter
2638
install: venv
27-
. "$(VENV_DIR)/bin/activate" && pip install -r requirements-dev.txt
39+
. "$(VENV_DIR)/bin/activate" && pip install -r requirements.txt
2840

2941

42+
#-----------------------------------
3043
$(OUTPUT_DIR):
3144
@mkdir -p $(OUTPUT_DIR)
32-
. "$(VENV_DIR)/bin/activate" && cookiecutter --output-dir "$(OUTPUT_DIR)" "$(TEMPLATE)"
33-
45+
. "$(VENV_DIR)/bin/activate" && cookiecutter --output-dir "$(OUTPUT_DIR)" "$(TEMPLATE)"
3446

3547
.PHONY: run
36-
# target: run - Runs cookiecutter into output folder
37-
run: $(OUTPUT_DIR) venv
38-
39-
.PHONY: replay
40-
replay:
41-
. "$(VENV_DIR)/bin/activate" && cookiecutter --no-input -f --config-file=".cookiecutterrc-ignore" --output-dir "$(OUTPUT_DIR)" "$(TEMPLATE)"
48+
# target: run – runs cookiecutter into output folder
49+
run: install $(OUTPUT_DIR)
50+
@touch .tmp-ran
4251

52+
.tmp-ran: run
4353

54+
#-----------------------------------
55+
.PHONY: replay
56+
# target: replay – replays cookiecutter using customized .cookiecutterrc-ignore
57+
replay: .tmp-ran
58+
. "$(VENV_DIR)/bin/activate" && cookiecutter --no-input -f --config-file=".cookiecutterrc-ignore" --output-dir "$(OUTPUT_DIR)" "$(TEMPLATE)"
4459

60+
#-----------------------------------
4561
.PHONE: test
62+
# target: test – tests backed cookie
4663
test: install
4764
. "$(VENV_DIR)/bin/activate" && pytest -s -c $(CURDIR)/pytest.ini
4865

49-
50-
66+
#-----------------------------------
5167
$(VENV_DIR):
5268
@python3 -m venv "$(VENV_DIR)"
5369
@"$(VENV_DIR)/bin/pip3" install --upgrade pip wheel setuptools
54-
@"$(VENV_DIR)/bin/pip3" install pylint
55-
@echo "To activate the virtual environment, execute 'source env/bin/activate'"
70+
@echo "To activate the virtual environment, execute 'source $(VENV_DIR)/bin/activate'"
5671

5772
.PHONY: venv
58-
# target: env – Create the virtual environment into venv folder
59-
venv: $(VENV_DIR)
73+
# target: venv – Create the virtual environment into venv folder
74+
venv: $(VENV_DIR)
75+
.venv: $(VENV_DIR)
76+
77+
78+
.PHONY: venv
79+
# target: requirements – Pip compile requirements.in
80+
requirements: requirements.in
81+
pip-compile -v --output-file requirements.txt requirements.in
82+
@touch requirements.txt
83+
84+
85+
86+
## -------------------------------
87+
# Auxiliary targets.
88+
89+
.PHONY: help
90+
# target: help – Display all callable targets
91+
help:
92+
@echo
93+
@egrep "^\s*#\s*target\s*:\s*" [Mm]akefile \
94+
| $(SED) -r "s/^\s*#\s*target\s*:\s*//g"
95+
@echo
96+
97+
98+
.PHONY: clean
99+
# target: clean – cleans projects directory
100+
clean:
101+
@find "$(CURDIR)" \
102+
-name "*.py[cod]" -exec rm -fv {} + -o \
103+
-name __pycache__ -exec rm -rfv {} +
104+
@rm -rfv \
105+
"$(CURDIR)/.cache" \
106+
"$(CURDIR)/.mypy_cache" \
107+
"$(CURDIR)/.pytest_cache"
108+
@rm -rf "$(OUTPUT_DIR)"
109+
@rm .tmp-*
110+
111+
112+
# target: clean-force – cleans & removes also venv folder
113+
clean-force: clean
114+
@rm -rf "$(VENV_DIR)"

0 commit comments

Comments
 (0)