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

add installation manifests #432

Merged
merged 85 commits into from Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
8fa4290
Initial commit
shahidhk Jun 12, 2018
5c9e305
add heroku instructions
shahidhk Jun 12, 2018
ed142bc
update heroku manifests
shahidhk Jun 13, 2018
a61558d
update repo name
shahidhk Jun 13, 2018
197863a
Update README.md
coco98 Jun 14, 2018
52f9653
Update README.md
coco98 Jun 14, 2018
5e5b200
Update README.md
coco98 Jun 14, 2018
04e1a12
Update README.md
coco98 Jun 14, 2018
ea2e518
Update README.md
coco98 Jun 14, 2018
dbc3e94
Update Dockerfile
coco98 Jun 14, 2018
e6a5c1f
add docker run instructions
shahidhk Jun 14, 2018
cc984b2
update raven image tag
shahidhk Jun 14, 2018
7e2ba28
remove cors flag, change domain to 8080
shahidhk Jun 14, 2018
f2f7d03
Merge pull request #1 from hasura/docker-run
shahidhk Jun 15, 2018
65ee8d1
Update README.md
coco98 Jun 19, 2018
5925efe
Update README.md
coco98 Jun 19, 2018
5318ec5
Update README.md
coco98 Jun 19, 2018
4516856
Adds docker-compose (#2)
karthikvt26 Jun 19, 2018
cbb4f32
Update README.md
coco98 Jun 19, 2018
203b9f9
Update README.md
coco98 Jun 19, 2018
e0da9df
Update README.md
coco98 Jun 19, 2018
3fa6775
Update README.md
coco98 Jun 19, 2018
18488e8
Update README.md
coco98 Jun 19, 2018
872431c
Update README.md
coco98 Jun 19, 2018
05bdddb
Update README.md
coco98 Jun 19, 2018
1f20e72
Moves directories
coco98 Jun 19, 2018
e9d8586
Update README.md
arvi3411301 Jun 19, 2018
8bed698
Delete Dockerfile
coco98 Jun 19, 2018
57c1345
Update docker-compose.yaml
coco98 Jun 20, 2018
0b8b37b
Delete README.md
coco98 Jun 21, 2018
b65818d
simplifies dir structure
coco98 Jun 21, 2018
ae4a92d
Update docker-compose.yaml
coco98 Jun 21, 2018
1272180
Update docker-run.sh
coco98 Jun 21, 2018
0c9d9f5
Fixed entrypoint command
wawhal Jun 21, 2018
55c30a3
Update docker-run.sh with commit id instead of latest
rikinsk Jun 22, 2018
36125d4
Update docker-compose.yaml with commit id instead of latest
rikinsk Jun 22, 2018
edbd839
Update docker-compose.yml with latest image
ecthiender Jun 25, 2018
a955151
Update docker-run.sh
coco98 Jun 25, 2018
440fa19
updated image tag to 190d78e
rakeshkky Jun 25, 2018
d2dd00d
Merge pull request #4 from hasura/image-190d78e
shahidhk Jun 25, 2018
5550e13
Merge branch 'master' into nomenclature
wawhal Jun 26, 2018
6ba8aab
Merge pull request #3 from hasura/nomenclature
shahidhk Jul 3, 2018
ecde9b9
Update docker-compose.yaml
shahidhk Jul 3, 2018
2721f6f
Update docker-run.sh
shahidhk Jul 3, 2018
4e75f1c
Update docker-compose.yaml
shahidhk Jul 3, 2018
28cab47
Update docker-run.sh
shahidhk Jul 3, 2018
0ffe9e3
Update docker-compose.yaml
shahidhk Jul 4, 2018
b865377
Update docker-compose.yaml
shahidhk Jul 4, 2018
258ff56
Update docker-compose.yaml
shahidhk Jul 9, 2018
4820303
Update docker-run.sh
shahidhk Jul 9, 2018
41c8fc3
Update docker-compose.yaml
shahidhk Jul 11, 2018
2f8a160
Update docker-run.sh
shahidhk Jul 11, 2018
b29e468
Update docker-compose.yaml
shahidhk Jul 16, 2018
8328847
Update docker-run.sh
shahidhk Jul 16, 2018
240c83a
Update docker-compose.yaml
shahidhk Jul 17, 2018
9361d19
Update docker-run.sh
shahidhk Jul 17, 2018
b6f9896
Update docker-run.sh
coco98 Jul 18, 2018
27defd2
Update docker-compose.yaml
shahidhk Jul 20, 2018
5246896
Update docker-run.sh
shahidhk Jul 20, 2018
f43007d
update image version to v1.0.0-alpha10
dliub Jul 24, 2018
84b1d6b
Update docker-run.sh
shahidhk Jul 24, 2018
6bfedc9
Merge pull request #5 from hasura/v1.0.0-alpha10
shahidhk Jul 24, 2018
b6ac223
update image version to v1.0.0-alpha11 (#6)
hasura-bot Jul 30, 2018
46eae8d
Update docker-run.sh
wawhal Jul 30, 2018
c66757c
restructure the repo
shahidhk Aug 6, 2018
e5924e7
add readme
shahidhk Aug 6, 2018
3b61604
Merge pull request #7 from hasura/restructure
rikinsk Aug 6, 2018
7c1e506
Update README.md
shahidhk Aug 6, 2018
a0a05a4
Update README.md
shahidhk Aug 6, 2018
e4b452d
Update image version to v1.0.0-alpha12 (#8)
hasura-bot Aug 6, 2018
c99aaaa
Update docker-compose.yaml
shahidhk Aug 8, 2018
745b920
update image version to v1.0.0-alpha13 (#9)
hasura-bot Aug 10, 2018
503a6de
Adds kubernetes
coco98 Aug 12, 2018
f70e1e4
change args to use env var
shahidhk Aug 13, 2018
ca64310
update image version to v1.0.0-alpha14 (#10)
hasura-bot Aug 22, 2018
0a1ca7b
Update image version to v1.0.0-alpha15 (#11)
hasura-bot Aug 30, 2018
afc5ab6
Update image version to v1.0.0-alpha16 (#12)
hasura-bot Sep 5, 2018
70779c7
Update image version to v1.0.0-alpha17 (#13)
hasura-bot Sep 7, 2018
25b50b0
Update image version to v1.0.0-alpha18 (#14)
hasura-bot Sep 8, 2018
5204598
reorganise
shahidhk Sep 13, 2018
a019495
Merge install manifests repo into install-manifests
shahidhk Sep 13, 2018
1aa2d14
update references to install manifests
shahidhk Sep 13, 2018
1f26ff4
update scripts
shahidhk Sep 13, 2018
3923a12
update readme
shahidhk Sep 13, 2018
2a0db8d
update ciignore
shahidhk Sep 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .ciignore
Expand Up @@ -4,6 +4,7 @@ scripts/*
assets/*
docs/*
community/*
install-manifests/*
.circleci/*
.ciignore
.gitignore
1 change: 0 additions & 1 deletion .circleci/deploy.sh
Expand Up @@ -104,6 +104,5 @@ if [[ ! -z "$CIRCLE_TAG" ]]; then
deploy_server_latest
draft_github_release
configure_git
send_pr_to_repo graphql-engine-install-manifests
send_pr_to_repo graphql-engine-heroku
fi
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -78,7 +78,9 @@ The fastest way to try Hasura out is via Heroku.

### Other deployment methods

For Docker-based deployment and advanced configuration options, see [deployment guides](https://docs.hasura.io/1.0/graphql/manual/getting-started/index.html).
For Docker-based deployment and advanced configuration options, see [deployment
guides](https://docs.hasura.io/1.0/graphql/manual/getting-started/index.html) or
[install manifests](install-manifests).

## Architecture

Expand Down Expand Up @@ -165,7 +167,7 @@ written more about what you can and cannot do under AGPL
SLAs are available on request. Please feel free to contact us at build@hasura.io
or on our [website chat](https://hasura.io).

All **other contents** (except those in [`server`](server), [`cli`](cli) and
All **other content** (except those in [`server`](server), [`cli`](cli) and
[`console`](console) directories) are under [MIT License](LICENSE-community).
This includes everything in the [`docs`](docs) and [`community`](community)
directories.
13 changes: 10 additions & 3 deletions cli/CONTRIBUTING.md
Expand Up @@ -45,9 +45,16 @@ already be in your `PATH`. The config is located at `.realize/realize.yaml`.

## Tests

When you're adding a new feature, it is encouraged to add integration tests (unit tests also if possible) for the functions/api. You should run all the test and make sure everything passes before submitting the PR.

The tests expect a GraphQL Engine server instance to be running. You can point the tests to any GraphQL Engine server but please note that **the database should be empty**. The easiest way to do this is to run an Postgres and GraphQL Engine using [Docker Compose](https://github.com/hasura/graphql-engine-install-manifests). Once the server is running, you can run the tests by executing the make command:
When you're adding a new feature, it is encouraged to add integration tests
(unit tests also if possible) for the functions/api. You should run all the test
and make sure everything passes before submitting the PR.

The tests expect a GraphQL Engine server instance to be running. You can point
the tests to any GraphQL Engine server but please note that **the database
should be empty**. The easiest way to do this is to run an Postgres and GraphQL
Engine using [Docker
Compose](https://github.com/hasura/graphql-engine/tree/master/install-manifests).
Once the server is running, you can run the tests by executing the make command:

```bash
HASURA_GRAPHQL_TEST_ENDPOINT=http://localhost:8080 VERSION=dev make test
Expand Down
21 changes: 0 additions & 21 deletions docs/LICENSE

This file was deleted.

2 changes: 1 addition & 1 deletion docs/README.md
Expand Up @@ -10,4 +10,4 @@ Checkout the [contributing](CONTRIBUTING.md) guide for more details.

## License

The source code in this directory are under [MIT License](LICENSE-community).
The source code in this directory are under [MIT License](../LICENSE-community).
4 changes: 2 additions & 2 deletions docs/graphql/manual/deployment/docker/index.rst
Expand Up @@ -12,12 +12,12 @@ and connect it to your Postgres database.
Step 1: Get the docker run bash script
--------------------------------------

The `hasura/graphql-engine-install-manifests <https://github.com/hasura/graphql-engine-install-manifests>`_ repo
The `hasura/graphql-engine/install-manifests <https://github.com/hasura/graphql-engine/tree/master/install-manifests>`_ repo
contains all installation manifests required to deploy Hasura anywhere. Get the docker run bash script from there:

.. code-block:: bash

$ wget https://raw.githubusercontent.com/hasura/graphql-engine-install-manifests/master/docker-run/docker-run.sh
$ wget https://raw.githubusercontent.com/hasura/graphql-engine/master/install-manifests/docker-run/docker-run.sh

Step 2: Run the hasura docker container
---------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/graphql/manual/deployment/kubernetes/index.rst
Expand Up @@ -8,14 +8,14 @@ and connect it to your Postgres database.
Step 1: Get the Kubernetes deployment and service files
-------------------------------------------------------

The `hasura/graphql-engine-install-manifests <https://github.com/hasura/graphql-engine-install-manifests>`_ repo
The `hasura/graphql-engine/install-manifests <https://GitHub.com/hasura/graphql-engine/tree/master/install-manifests>`_ repo
contains all installation manifests required to deploy Hasura anywhere. Get the Kubernetes deployment and service files
from there:

.. code-block:: bash

$ wget https://raw.githubusercontent.com/hasura/graphql-engine-install-manifests/master/kubernetes/deployment.yaml
$ wget https://raw.githubusercontent.com/hasura/graphql-engine-install-manifests/master/kubernetes/svc.yaml
$ wget https://raw.githubusercontent.com/hasura/graphql-engine/master/install-manifests/kubernetes/deployment.yaml
$ wget https://raw.githubusercontent.com/hasura/graphql-engine/master/install-manifests/kubernetes/svc.yaml

Step 2: Set the Postgres database url
-------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/graphql/manual/getting-started/docker-simple.rst
Expand Up @@ -17,13 +17,13 @@ guide to :doc:`deploy the Hasura GraphQL engine as a standalone docker container
Step 1: Get the docker-compose file
-----------------------------------

The `hasura/graphql-engine-install-manifests <https://github.com/hasura/graphql-engine-install-manifests>`_ repo
The `hasura/graphql-engine/install-manifests <https://github.com/hasura/graphql-engine/tree/master/install-manifests>`_ repo
contains all installation manifests required to deploy Hasura anywhere. Get the docker compose file from there:

.. code-block:: bash

# in a new directory
wget https://raw.githubusercontent.com/hasura/graphql-engine-install-manifests/master/docker-compose/docker-compose.yaml
wget https://raw.githubusercontent.com/hasura/graphql-engine/master/install-manifests/docker-compose/docker-compose.yaml

Step 2: Run Hasura GraphQL engine & Postgres
--------------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions install-manifests/README.md
@@ -0,0 +1,13 @@
# Hasura GraphQL Engine Installation Manifests

Various installation / deployment methods for Hasura GraphQL Engine

1. [Docker Compose](docker-compose)
2. [Docker Compose with HTTPS using Caddy](docker-compose-https)
3. [Docker run](docker-run)
3. [Kubernetes](kubernetes)


## License

All content in this directory is under [MIT License](../LICENSE-community).
5 changes: 5 additions & 0 deletions install-manifests/docker-compose-https/Caddyfile
@@ -0,0 +1,5 @@
<your-domain.com> {
proxy / graphql-engine:8080 {
websocket
}
}
27 changes: 27 additions & 0 deletions install-manifests/docker-compose-https/README.md
@@ -0,0 +1,27 @@
# Hasura GraphQL Engine on Docker with HTTPS

This Docker Compose setup runs [Hasura GraphQL Engine](https://github.com/hasura/graphql-engine) with [Caddy](https://caddyserver.com) webserver and automatic HTTPS certs from [LetsEncrypt](https://letsencrypt.org/).

## Pre-requisites

- [Docker](https://docs.docker.com/install/)
- [Docker Compose](https://docs.docker.com/compose/install/)

## Usage

- Clone this repo on a machine with a public ip address
- Map your domain name to this ip address
- Edit `Caddyfile` and add your domain (replace `<your-domain.com>` with your domain, don't keep `<>`)
- Edit `docker-compose.yaml` and change `HASURA_GRAPHQL_ACCESS_KEY` to something secure
- `docker-compose up -d`

GraphQL endpoint will be `https://<your-domain.com>/v1alpha1/graphql`
Console will be available on `https://<your-domain.com>/console`

## Connecting to External Postgres

If you want to connect to an external/existing postgres database, replace `HASURA_GRAPHQL_DATABASE_URL` in `docker-compose.yaml` with your database url.

**Note: localhost will resolve to the container ip inside a docker container, not the host ip**


33 changes: 33 additions & 0 deletions install-manifests/docker-compose-https/docker-compose.yaml
@@ -0,0 +1,33 @@
version: '3.6'
services:
postgres:
image: postgres
restart: always
volumes:
- db_data:/var/lib/postgresql/data
graphql-engine:
image: hasura/graphql-engine:v1.0.0-alpha18
depends_on:
- "postgres"
restart: always
environment:
HASURA_GRAPHQL_ACCESS_KEY: mysecretaccesskey
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@postgres:5432/postgres
command:
- graphql-engine
- serve
- --enable-console
caddy:
image: abiosoft/caddy
depends_on:
- "graphql-engine"
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/Caddyfile
- caddy_certs:/root/.caddy
volumes:
db_data:
caddy_certs:
24 changes: 24 additions & 0 deletions install-manifests/docker-compose/README.md
@@ -0,0 +1,24 @@
# Hasura GraphQL Engine on Docker

This Docker Compose setup runs [Hasura GraphQL Engine](https://github.com/hasura/graphql-engine) along with Postgres using `docker-compose`.

## Pre-requisites

- [Docker](https://docs.docker.com/install/)
- [Docker Compose](https://docs.docker.com/compose/install/)

## Usage

- Clone this repo on a machine where you'd like to deploy graphql engine
- `docker-compose up -d`

GraphQL endpoint will be `https://<your-domain.com>/v1alpha1/graphql`
Console will be available on `https://<your-domain.com>/console`

## Connecting to External Postgres

If you want to connect to an external/existing postgres database, replace `HASURA_GRAPHQL_DATABASE_URL` in `docker-compose.yaml` with your database url.

**Note: localhost will resolve to the container ip inside a docker container, not the host ip**


22 changes: 22 additions & 0 deletions install-manifests/docker-compose/docker-compose.yaml
@@ -0,0 +1,22 @@
version: '3.6'
services:
postgres:
image: postgres
restart: always
volumes:
- db_data:/var/lib/postgresql/data
graphql-engine:
image: hasura/graphql-engine:v1.0.0-alpha18
ports:
- "8080:8080"
depends_on:
- "postgres"
restart: always
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:@postgres:5432/postgres
command:
- graphql-engine
- serve
- --enable-console
volumes:
db_data:
6 changes: 6 additions & 0 deletions install-manifests/docker-run/docker-run.sh
@@ -0,0 +1,6 @@
#! /bin/bash
docker run -d -p 8080:8080 \
hasura/graphql-engine:v1.0.0-alpha18 \
graphql-engine \
--database-url postgres://username:password@hostname:port/dbname \
serve --enable-console
33 changes: 33 additions & 0 deletions install-manifests/kubernetes/README.md
@@ -0,0 +1,33 @@
# Deploy Hasura GraphQL engine on Kubernetes

### Step 1: Edit deployment.yaml and set the right database url

```yaml
...
env:
- name: HASURA_GRAPHQL_DATABASE_URL
value: postgres://username:password@hostname:port/dbname
...
```

### Step 2: Create the kubernetes deployment, service

```
kubectl create -f deployment.yaml
kubectl create -f svc.yaml
```

### Step 3: Access the console
This creates a LoadBalancer type service with port 80. So you should be able to
access the console at the external IP.

For example, using docker-for-desktop on mac:

```
$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hasura LoadBalancer 10.96.214.240 localhost 80:30303/TCP 4m
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 8m
```

Head to: `http://localhost` and the console should load!
32 changes: 32 additions & 0 deletions install-manifests/kubernetes/deployment.yaml
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hasura
hasuraService: custom
name: hasura
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: hasura
template:
metadata:
creationTimestamp: null
labels:
app: hasura
spec:
containers:
- image: hasura/graphql-engine:v1.0.0-alpha18
imagePullPolicy: IfNotPresent
name: hasura
command: ["graphql-engine"]
args: ["serve", "--enable-console"]
env:
- name: HASURA_GRAPHQL_DATABASE_URL
value: postgres://username:password@hostname:port/dbname
ports:
- containerPort: 8080
protocol: TCP
resources: {}
15 changes: 15 additions & 0 deletions install-manifests/kubernetes/svc.yaml
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: hasura
name: hasura
namespace: default
spec:
ports:
- protocol: TCP
port: 80
targetPort: 8080
selector:
app: hasura
type: LoadBalancer
42 changes: 42 additions & 0 deletions scripts/tag-release.sh
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
#
# tag-release.sh
#
# Update installation manifests with the release tag, and execute other release
# hygiene tasks, makes a commit and tags that commit with the given tag.
#
# Usage: ./tag-release.sh <tag> [<optional-tag-message>]
#
# Example: ./tag-release.sh v1.1.0
#

# exit on error
set -e

# get the repo root
ROOT="$(readlink -f ${BASH_SOURCE[0]%/*}/../)"

# check if required argument is set
if [ -z "$1" ]; then
echo "Usage: ./tag-release.sh <tag> [<optional-tag-message>]"
exit 1
fi

# assign arguments to variables
TAG=$1
MESSAGE=$2

# default message to tag
if [ -z "$MESSAGE" ]; then
MESSAGE="$TAG"
fi

# replace the image version with latest tag for all references in install-manifests
find "$ROOT/install-manifests" -type f -exec sed -i -E 's#(hasura/graphql-engine:)v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(\-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?( \\)*$#\1'"${TAG}"'\9#' {} \;

git add "$ROOT/install-manifests"
git commit -m "update installation manifests to $TAG"

git tag -a "$TAG" -m "$MESSAGE"

echo "tagged $TAG"