You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5. Use your favorite editor to append these lines at the end of the file `docker-compose.yml` (replace `<GRLC_CLONE_PATH>` with the absolute path where you cloned grlc in step 2):
29
-
27
+
4. Create a `docker-compose.yml` which matches your needs. For example:
30
28
```
31
-
volumes:
32
-
- <GRLC_CLONE_PATH>:/home/grlc/grlc
29
+
version: '2'
30
+
services:
31
+
grlc:
32
+
build: ./
33
+
restart: unless-stopped
34
+
ports:
35
+
- "8001:80"
36
+
environment:
37
+
- DEBUG=true
38
+
- USERMAP_GID=1000
39
+
- USERMAP_UID=1000
40
+
- GRLC_GITHUB_ACCESS_TOKEN=xxx
41
+
- GRLC_SERVER_NAME=grlc.io
33
42
```
34
43
35
-
6.`docker-compose up`
36
-
7. Your local grlc instance should be available at http://localhost:8001 and should respond to code modifications you make on `<GRLC_CLONE_PATH>`
44
+
5.`docker-compose up`
45
+
6. Your local grlc instance should be available at http://localhost:8001 and should respond to code modifications you make on `<GRLC_CLONE_PATH>`
37
46
38
47
You're good to pick any issue at the [issue tracker](https://github.com/CLARIAH/grlc/issues) marked as **enhancement** and start implementing it :)
Copy file name to clipboardExpand all lines: README.md
+48-43Lines changed: 48 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,69 +43,74 @@ For a quick usage tutorial check out our wiki walkthrough [here](https://github.
43
43
44
44
## Install and run
45
45
46
-
Running via [docker](https://www.docker.com/) is the easiest and preferred form of deploying grlc. You'll need a working installation of [docker](https://www.docker.com/) and [docker-compose](https://docs.docker.com/compose/). To deploy grlc, just pull the latest image from Docker hub, and run docker compose with a `docker-compose.yml` that suits your needs (an [example](docker-compose.default.yml) is provided in the root directory):
46
+
### grlc.io
47
+
The easiest way to use grlc is by visiting [grlc.io/](http://grlc.io/) and using this service to convert SPARQL queries on your github repo into a RESTful API.
47
48
48
-
<pre>
49
-
git clone https://github.com/CLARIAH/grlc
50
-
cd grlc
51
-
docker pull clariah/grlc
52
-
docker-compose -f docker-compose.default.yml up
53
-
</pre>
54
-
55
-
To run directly from Docker Hub it is sufficient to do:
(You can omit the first two commands if you just copy [this file](docker-compose.default.yml) somehwere in your filesystem)
61
-
If you use the supplied `docker-compose.default.yml` your grlc instance will be available at http://localhost:8001
62
-
63
-
If you want your grlc instance to forward queries to a different service than `grlc.io`, edit the `GRLC_SERVER_NAME` variable in your `docker-compose.yml` or `docker-compose.default.yml` file.
64
-
65
-
In order for grlc to communicate with GitHub, you'll need to tell grlc what your access token is:
66
-
67
-
1. Get a GitHub personal access token. In your GitHub's profile page, go to _Settings_, then _Developer settings_, _Personal access tokens_, and _Generate new token_
68
-
2. You'll get an access token string, copy it and save it somewhere safe (GitHub won't let you see it again!)
69
-
3. Edit your `docker-compose.yml` or `docker-compose.default.yml` file, and paste this token as value of the environment variable GRLC_GITHUB_ACCESS_TOKEN
70
-
71
-
If you want to run grlc at system boot as a service, you can find example upstart scripts at [upstart/](upstart/grlc-docker.conf)
72
-
73
-
### Alternative install methods
74
-
75
-
Through these you'll miss some cool docker bundled features (like nginx-based caching). We provide these alternatives just for testing, development scenarios, or docker compatibility reasons.
49
+
### Pip
50
+
If you want to run grlc locally or use it as a library, you can install grlc on your machine. Grlc is [registered in PyPi](https://pypi.org/project/grlc/) so you can install it using pip.
76
51
77
52
#### Prerequisites
78
53
- Python3
79
54
- development files:
80
-
81
55
```bash
82
56
sudo apt-get install libevent-dev python-all-dev
83
57
```
84
58
85
-
#### pip
86
-
87
-
If you want to use grlc as a library, you'll find it useful to install via `pip`.
88
-
89
-
<pre>
59
+
#### pip install
60
+
```bash
90
61
pip install grlc
91
-
grlc-server
92
-
</pre>
62
+
```
93
63
94
-
More details can be found at [grlc's PyPi page](https://pypi.python.org/pypi/grlc) (thanks to [c-martinez](https://github.com/c-martinez)!).
64
+
Grlc includes a command line tool which you can use to start your own grlc server:
65
+
```bash
66
+
grlc-server
67
+
```
95
68
96
-
#### Flask application
69
+
#### Using gunicorn
70
+
You can run grlc using gunicorn as follows:
71
+
```bash
72
+
gunicorn grlc.server:app
73
+
```
97
74
98
-
You can run grlc natively as follows:
75
+
If you want to use your own gunicorn configuration, for example `gunicorn_config.py`:
76
+
```
77
+
workers = 5
78
+
worker_class = 'gevent'
79
+
bind = '0.0.0.0:8088'
99
80
```
100
-
gunicorn -c gunicorn_config.py src.server:app
81
+
Then you can run it as:
82
+
```bash
83
+
gunicorn -c gunicorn_config.py grlc.server:app
101
84
```
102
85
103
86
**Note:** Since `gunicorn` does not work under Windows, you can use `waitress` instead:
87
+
```bash
88
+
waitress-serve --port=8088 grlc.server:app
104
89
```
105
-
waitress-serve --port=8088 src.server:app
90
+
91
+
#### Grlc library
92
+
You can use grlc as a library directly from your own python script. See the [usage example](https://github.com/CLARIAH/grlc/blob/master/doc/notebooks/GrlcFromNotebook.ipynb) to find out more.
93
+
94
+
### Docker
95
+
To run grlc via [docker](https://www.docker.com/), you'll need a working installation of docker. To deploy grlc, just pull the [latest image from Docker hub](https://hub.docker.com/r/clariah/grlc/). :
96
+
```bash
97
+
docker run -it --rm -p 8088:80 clariah/grlc
106
98
```
107
99
108
-
You can also find an example [here](https://github.com/CLARIAH/grlc/blob/master/docker-assets/entrypoint.sh#L24)
100
+
The docker image allows you to setup several environment variable such as `GRLC_SERVER_NAME``GRLC_GITHUB_ACCESS_TOKEN` and `GRLC_SPARQL_ENDPOINT`:
In order for grlc to communicate with GitHub, you'll need to tell grlc what your access token is:
108
+
109
+
1. Get a GitHub personal access token. In your GitHub's profile page, go to _Settings_, then _Developer settings_, _Personal access tokens_, and _Generate new token_
110
+
2. You'll get an access token string, copy it and save it somewhere safe (GitHub won't let you see it again!)
111
+
3. Edit your `docker-compose.yml` or `docker-compose.default.yml` file, and paste this token as value of the environment variable GRLC_GITHUB_ACCESS_TOKEN
112
+
113
+
If you want to run grlc at system boot as a service, you can find example upstart scripts at [upstart/](upstart/grlc-docker.conf)
0 commit comments