-
Notifications
You must be signed in to change notification settings - Fork 7
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 #48 from mrinalwahal/final
Done and Dusted
- Loading branch information
Showing
17 changed files
with
828 additions
and
612 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 |
---|---|---|
@@ -1,28 +1,32 @@ | ||
# [GIN](https://gin.g-node.org) gin-proc Microservice | ||
# gin-proc Microservice for [GIN](https://gin.g-node.org) | ||
|
||
<br> | ||
|
||
[![G-Node](./images/favicon.png)](https://gin.g-node.org) | ||
|
||
This repository contains documentation for using the **gin-proc** microservice for **[GIN](https://gin.g-node.org)** s as well as its setup and support scripts. | ||
|
||
Please file an issue if you are experiencing a problem or would like to discuss something related to the microservice. | ||
|
||
Pull requests are encouraged if you have changes you believe would improve the setup process or increase compatibility across deployment environments. | ||
This repository contains documentation for using the **gin-proc** microservice for **[GIN](https://gin.g-node.org)** with INCF **as a part of Google Summer of Code (GSoC) 2019 programme**, as well as its setup and support scripts. | ||
|
||
<br> | ||
|
||
## Table of Contents | ||
* **[Introduction](#introduction)** | ||
- [Problem statement](#problem) | ||
- [Rationale and Significance](#rationale) | ||
* **[Installation](#install)** | ||
- [GIN's hosted cloud](#cloud) | ||
- [Local environment](#local) | ||
* **[Usage](#usage)** | ||
* **[Tests](#tests)** | ||
* **[FAQ](#questions)** | ||
* **[License](#project-license)** | ||
* **[Installation](docs/install.md)** | ||
- [GIN's hosted cloud](docs/install.md#cloud) | ||
- [Local environment](docs/install.md#local) | ||
- [Docker Compose](docs/install.md#docker-compose) | ||
- [Manual](docs/install.md#manual) | ||
* **[Usage](docs/usage.md)** | ||
- [Workflows](docs/usage.md#workflows) | ||
- [User's Files](docs/usage.md#files) | ||
* **[Operations](docs/operations.md)** | ||
- [After Login](docs/operations.md#after-login) | ||
- [API](http://<GIN-PROC-SERVER>:8000/docs/api/) | ||
- [Inside Pipeline](docs/operations.md#pipeline) | ||
* **[FAQ](docs/faq.md)** | ||
* **[Authors & Contribution](#authors)** | ||
* **[License](#license)** | ||
|
||
<br> | ||
|
||
|
@@ -45,119 +49,27 @@ INCF is hosting a GIN service designed above GOGS with Git to serve as a reposit | |
|
||
This tool/micro-service is required since, given the GIN user base of neuroscientists and other pro-fessionals from the related fields, shouldn’t be involved in writing thousands of repeated workflows for their data, and then testing it manually. This tool will increase their efficiency by almost exponential levels by eradicating redundancy from their work. | ||
|
||
<br> | ||
|
||
|
||
|
||
<a name="run-proc"></a> | ||
## Run gin-proc microservice | ||
|
||
Make sure your keys are installed with the GIN container. Micro-service, for now, skips ensuring/installing new keys on the GIN server (Its still in testing). | ||
|
||
From project's root... | ||
```export GIN_SERVER=<GIN_IP>:<GIN_PORT>``` | ||
|
||
```cd back-end && python server.py``` | ||
|
||
On a new console, go back to project's root and.. | ||
```cd front-end && npm run dev``` | ||
|
||
Log in at your front-end app's SERVER IP displayed in console on endpoint `/login`. | ||
Only log in with your GIN credentials. | ||
|
||
<br> | ||
|
||
<a name="usage"></a> | ||
## Usage | ||
|
||
In every repository that you create on gin, you have to mandatorily add a **.drone.yml** file which contains the pipelines and build jobs for drone to run. | ||
|
||
Use the sample `.drone.yml` file [attached](./samples/.drone.yml) in this repository. Or copy the contents from below. | ||
|
||
``` | ||
kind: pipeline | ||
name: default | ||
clone: | ||
disable: true | ||
steps: | ||
- name: clone | ||
image: docker:git | ||
environment: | ||
REPO: test | ||
GIN_USER: "<YOUR-GIN-USERNAME>" | ||
GIN_SERVER: "172.19.0.2" | ||
SSH_KEY: | ||
from_secret: DRONE_PRIVATE_SSH_KEY | ||
commands: | ||
- echo "[+] Starting SSH Agent" | ||
- eval $(ssh-agent -s) | ||
- echo "[+] Installing SSH Keys" | ||
- mkdir /root/.ssh && echo "$SSH_KEY" > /root/.ssh/id_rsa && chmod 0600 /root/.ssh/id_rsa | ||
- echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config | ||
- ssh-keyscan -H "$GIN_SERVER" >> /root/.ssh/known_hosts | ||
- ssh-add /root/.ssh/id_rsa | ||
# Uncomment the next line if you want to debug SSH Connection failures. | ||
# - ssh -Tv git@"$GIN_SERVER" -p 22 -i /root/.ssh/id_rsa | ||
- git clone git@"$GIN_SERVER":/"$GIN_USER"/"$REPO".git | ||
- echo "[+] Clone complete" | ||
# You can replace the following pipeline step and write your own beyond this point. | ||
- name: proc | ||
image: ubuntu | ||
environment: | ||
REPO: test | ||
commands: | ||
- apt-get update | ||
- apt-get install python -y | ||
- which python | ||
``` | ||
|
||
<br> | ||
|
||
<a name="tests"></a> | ||
## Tests | ||
|
||
The attached sample **.drone.yml** file can be simply used to test whether things are working fine. | ||
|
||
We are writing more scripts to perform testing. If anyone wishes to contribute test scripts, a pull request is more than welcome. | ||
|
||
<br> | ||
|
||
<a name="questions"></a> | ||
## FAQ | ||
|
||
Q: Drone throws `permission denied (publickey)` error. How do I resolve this? | ||
|
||
A: Add the line `- ssh -Tv [email protected] -p 22 -i /root/.ssh/id_rsa` in your clone job in .drone.yml file before running `git clone`. It will present you with complete debug logs of the SSH connection drone tries to make from its container to your GIN container. Errors presented there can help you resolve the issue faster. | ||
|
||
--- | ||
|
||
Q: I get a `Host Key authenticated failed` error during `git clone` in drone pipeline. | ||
|
||
A: Either your SSH keys that you have added to GIN and to Drone as a secret don't match, or you can also check if the key pairs you installed needed your sudo password to unlock the keys. If that's the case, create new key pairs without passphrases. And install them. | ||
|
||
<br> | ||
|
||
<a name="authors-contributors"></a> | ||
## Authors and Contributors | ||
<a name="authors"></a> | ||
## Authors and Contributions | ||
|
||
<table><tbody> | ||
<tr><th align="left">Achilleas Koutsou</th><td><a href="https://github.com/achilleas-k">GitHub/achilleas-k</a></td><td></td></tr> | ||
<tr><th align="left">Michael Sonntag</th><td><a href="https://github.com/mpsonntag">GitHub/mpsonntag</a></td><td></td></tr> | ||
<tr><th align="left">Mrinal Wahal</th><td><a href="https://gitlab.com/wahal">GitLab/wahal</a></td><td><a href="https://mrinalwahal.com/rvagg">MrinalWahal.com</a></td></tr> | ||
</tbody></table> | ||
|
||
Contributions are welcomed from anyone wanting to improve this project! | ||
Contributions are welcome from anyone wanting to improve this project! | ||
|
||
Please file an issue if you are experiencing a problem or would like to discuss something related to the microservice. | ||
|
||
Pull requests are encouraged if you have changes you believe would improve the setup process or increase compatibility across deployment environments. | ||
|
||
<br> | ||
|
||
<a name="project-license"></a> | ||
<a name="license"></a> | ||
## License | ||
|
||
This microservice is licensed under the BSD 3-Clause license. All rights not explicitly granted in the MIT license are reserved. See the included [LICENSE.md](./LICENSE.md) file for more details. | ||
|
@@ -166,7 +78,7 @@ This microservice is licensed under the BSD 3-Clause license. All rights not exp | |
|
||
*Supported with :heart: by [Achilleas Koutsou](https://github.com/achilleas-k), [Michael Sonntag](https://github.com/mpsonntag) and the [G-Node](https://github.com/orgs/G-Node/people) team.* | ||
|
||
*This project is affiliated with [G-Node](http://www.g-node.org/) and [GIN](https://gin.g-node.org).* | ||
*This project was completed as part of *Google Summer of Code (GSoC) 2019.* and is affiliated with [G-Node](http://www.g-node.org/) and [GIN](https://gin.g-node.org).* | ||
|
||
<br> | ||
|
||
|
Oops, something went wrong.