Skip to content

Commit 3d0a197

Browse files
authoredApr 15, 2022
Adding Gitpod Support (#706)
* adding gitpod files * cleanup gitpod Dockerfile
1 parent 8df1924 commit 3d0a197

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed
 

‎.gitpod.Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#FROM gitpod/workspace-full
2+
FROM gitpod/workspace-base
3+
4+
RUN sudo apt-get update && sudo apt-get -y -o Dpkg::Options::=--force-confold dist-upgrade && \
5+
DEBIAN_FRONTEND=noninteractive sudo apt-get -y -o Dpkg::Options::=--force-confold install \
6+
libffi-dev libsasl2-dev python3-dev libyaml-dev \
7+
libldap2-dev libssl-dev python3-pip python3-setuptools python3-venv \
8+
mysql-client nginx uwsgi uwsgi-plugin-python3 uwsgi-plugin-gevent-python3 \
9+
&& pip3 install mysql-connector-python \
10+
&& sudo rm -rf /var/cache/apt/archives/*

‎.gitpod.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
tasks:
2+
- name: Dependencies
3+
init: |
4+
python3 -m venv venv
5+
source venv/bin/activate
6+
pip install --upgrade pip wheel setuptools
7+
pip install -e '.[dev,kazoo]'
8+
gp sync-done installation
9+
- name: Database
10+
before: |
11+
# make sure to stop and remove mysql container before starting it again
12+
docker stop iris-db || true
13+
docker rm iris-db || true
14+
docker run --name iris-db -p 127.0.0.1:3306:3306/tcp -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql:5.7 --sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
15+
# wait for databse to be ready
16+
gp await-port 3306
17+
# Initialize Database
18+
echo "create database iris;" | mysql -h 127.0.0.1 -u root
19+
cat db/schema_0.sql | mysql -h 127.0.0.1 -u root iris
20+
cat db/dummy_data.sql | mysql -h 127.0.0.1 -u root iris
21+
22+
- name: Iris API
23+
init: |
24+
gp sync-await installation
25+
command: |
26+
source venv/bin/activate
27+
IRIS_CFG_DB_PASSWORD=root make
28+
- name: Iris Sender
29+
init: |
30+
gp sync-await installation
31+
command: |
32+
source venv/bin/activate
33+
IRIS_CFG_DB_PASSWORD=root make sender
34+
35+
ports:
36+
# Iris Sender
37+
- port: 2321
38+
onOpen: ignore
39+
visibility: private
40+
# Iris API
41+
- port: 16649
42+
onOpen: open-browser
43+
visibility: private
44+
# MySQL
45+
- port: 3306
46+
onOpen: ignore
47+
visibility: private
48+
49+
image:
50+
file: .gitpod.Dockerfile
51+

‎README.md

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Iris core, API, UI and sender service. For third-party integration support, see
55

66
<p align="center"><img src="https://github.com/linkedin/iris/raw/master/docs/source/_static/demo.png" width="600"></p>
77

8+
Quick Start with Gitpod
9+
--------------
10+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/linkedin/iris)
811

912
Setup database
1013
--------------

0 commit comments

Comments
 (0)