rubypitaya 1.5.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ce9fce444231d413f663d1af94356f0a04204af86050e6041a24f3b2bf37d8d
4
- data.tar.gz: cc4c79730ea4e46891bff56f635c0135c62adc0f5ce06c6a473567bd46a48b78
3
+ metadata.gz: 8c64a441e12fb5d3a9b7ff19762a9bc5a3ce3dea73ae73d98693dba745e49299
4
+ data.tar.gz: 7893c9fabe736b60619c6758645bb12e6a87a90f3f8e417096a077499613f1bc
5
5
  SHA512:
6
- metadata.gz: 46fff9b02c5d40577864c21bd226d7b412b93d70af22612b3dfe39409546d2b14361f2f63d0ba0f4c07db5fe118908d4700b804c5ad134f7ceb06e8c94b5cdc2
7
- data.tar.gz: 40b3def401682e4f98e6efaabaad9afc384128f6e0a39a3ae495d36643155bab86c1913969fd3ac35f647275836b06c24aafd818dcf7e2657618ffb1754587ee
6
+ metadata.gz: a6c8988dc0946445a6f7d2921344a1f80f342a476050d8c5c10a7cb671bb6a8b01be447bdcd3ce35b04ca5a11bab5772c2fff319c8de5dca3c7dd6a625fcb53a
7
+ data.tar.gz: b0edc4b5f49fa1b1ddd710aaf27072705c3ac967453d1244a0c51f37e5a9d6cc1b4a802de0ca260ec027f18d3714b1d4d39dd3eabc2e5956de29dde9cd715cba
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'rubypitaya', '1.5.0'
3
+ gem 'rubypitaya', '1.7.1'
4
4
 
5
5
  group :development do
6
6
  gem 'pry', '0.12.2'
@@ -62,7 +62,7 @@ GEM
62
62
  diff-lcs (>= 1.2.0, < 2.0)
63
63
  rspec-support (~> 3.8.0)
64
64
  rspec-support (3.8.3)
65
- rubypitaya (1.5.0)
65
+ rubypitaya (1.7.1)
66
66
  activerecord (= 6.0.2)
67
67
  etcdv3 (= 0.10.2)
68
68
  eventmachine (= 1.2.7)
@@ -85,7 +85,7 @@ DEPENDENCIES
85
85
  pry (= 0.12.2)
86
86
  rake (= 10.0)
87
87
  rspec (= 3.8.0)
88
- rubypitaya (= 1.5.0)
88
+ rubypitaya (= 1.7.1)
89
89
 
90
90
  BUNDLED WITH
91
91
  1.17.2
@@ -44,7 +44,15 @@ generate-gemfilelock:
44
44
 
45
45
  ## Build image to production environment
46
46
  prod-build-image:
47
- @docker build . -f docker/prod/Dockerfile -t rubypitaya-prod:latest
47
+ @docker build . -f docker/prod/Dockerfile -t [registry-address]:$(IMAGE_TAG)
48
+
49
+ ## Push prod image to gitlab
50
+ prod-push-image:
51
+ @docker push [registry-address]:$(IMAGE_TAG)
52
+
53
+ ## Deploy prod image to kubernetes cluster
54
+ prod-deploy-image:
55
+ kubectl -n $(PROD_NAMESPACE) set image deployment rubypitaya rubypitaya=[registry-address]:$(IMAGE_TAG)
48
56
 
49
57
  .DEFAULT_GOAL := show-help
50
58
 
@@ -12,7 +12,7 @@ services:
12
12
  - '2380:2380'
13
13
 
14
14
  redis:
15
- image: 'redis:3.2.5-alpine'
15
+ image: 'redis:6.0.5-alpine'
16
16
  ports:
17
17
  - '9001:6379'
18
18
 
@@ -22,7 +22,7 @@ services:
22
22
  - 'postgres:/var/lib/postgresql/data'
23
23
  environment:
24
24
  POSTGRES_USER: 'postgres'
25
- POSTGRES_HOST_AUTH_METHOD: 'trust'
25
+ POSTGRES_PASSWORD: 'postgres'
26
26
  ports:
27
27
  - '9100:5432'
28
28
 
@@ -67,7 +67,7 @@ services:
67
67
  REDIS_URL: 'redis://redis:6379'
68
68
  DATABASE_HOST: 'db'
69
69
  DATABASE_USER: 'postgres'
70
- DATABASE_PASSWORD: ''
70
+ DATABASE_PASSWORD: 'postgres'
71
71
  DATABASE_NAME: 'ruby_pitaya'
72
72
 
73
73
  volumes:
@@ -16,4 +16,4 @@ ENV LC_ALL=C.UTF-8
16
16
 
17
17
  ENTRYPOINT ["./docker/entrypoint.sh"]
18
18
 
19
- CMD ["bundle", "exec", "rubypitaya"]
19
+ CMD ["bundle", "exec", "rubypitaya", "run"]
@@ -29,4 +29,4 @@ ENV LC_ALL=C.UTF-8
29
29
 
30
30
  ENTRYPOINT ["./docker/entrypoint.sh"]
31
31
 
32
- CMD ["bundle", "exec", "rubypitaya"]
32
+ CMD ["bundle", "exec", "rubypitaya", "run"]
@@ -0,0 +1,60 @@
1
+ Kubernetes Configuration
2
+ ========================
3
+
4
+ Set namespace
5
+ -------------
6
+
7
+ Open files "deployment-*.yaml" and set the correct namespace on links
8
+
9
+
10
+ Apply sequence
11
+ --------------
12
+
13
+ Run the following command on the listed files.
14
+ But remember to put your namespace and your KUBECONFIG env var if you need.
15
+
16
+ ```sh
17
+ $ kubectl apply -f [file-path]
18
+ ```
19
+
20
+ persistent-volume.yaml
21
+
22
+ statefulset-etcd.yaml
23
+ statefulset-nats.yaml
24
+ statefulset-postgres.yaml
25
+ statefulset-redis.yaml
26
+
27
+ service-etcd.yaml
28
+ service-nats.yaml
29
+ service-postgres.yaml
30
+ service-redis.yaml
31
+
32
+ deployment-connector.yaml
33
+ service-connector.yaml
34
+
35
+
36
+ Create gitlab-registry secret
37
+ -----------------------------
38
+
39
+ Run the following command.
40
+ But remember to put your namespace and your KUBECONFIG env var if you need.
41
+
42
+ ```sh
43
+ $ kubectl create secret docker-registry gitlab-registry --docker-server=[registry-server] --docker-username=[username] --docker-password=[password]
44
+ ```
45
+
46
+ If you use a different registry name instead of "gitlab-registry" change the deployment-rubypitaya.yaml imagePullSecrets.name
47
+
48
+
49
+ Apply sequence
50
+ --------------
51
+
52
+ Run the following command on the listed files.
53
+ But remember to put your namespace and your KUBECONFIG env var if you need.
54
+
55
+ ```sh
56
+ $ kubectl apply -f [file-path]
57
+ ```
58
+
59
+ deployment-rubypitaya.yaml
60
+ service-rubypitaya.yaml
@@ -0,0 +1,35 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: connector
5
+ labels:
6
+ app: connector
7
+ spec:
8
+ replicas: 1
9
+ selector:
10
+ matchLabels:
11
+ app: connector
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: connector
16
+ spec:
17
+ containers:
18
+ - name: connector
19
+ image: registry.gitlab.com/lucianopc/pitaya-connector:0.2.0
20
+ ports:
21
+ - containerPort: 3250
22
+ name: connector
23
+ env:
24
+ - name: PITAYA_CLUSTER_RPC_SERVER_NATS_CONNECT
25
+ value: "nats://nats.default.svc.cluster.local:4222"
26
+ - name: PITAYA_CLUSTER_RPC_CLIENT_NATS_CONNECT
27
+ value: "nats://nats.default.svc.cluster.local:4222"
28
+ - name: PITAYA_CLUSTER_RPC_CLIENT_NATS_REQUESTTIMEOUT
29
+ value: "10s"
30
+ - name: PITAYA_CLUSTER_SD_ETCD_ENDPOINTS
31
+ value: "etcd.default.svc.cluster.local:2379"
32
+ - name: PITAYA_CLUSTER_SD_ETCD_PREFIX
33
+ value: "rubypitaya/"
34
+ - name: SERVER_ROUTES
35
+ value: "rubypitaya"
@@ -0,0 +1,48 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: rubypitaya
5
+ labels:
6
+ app: rubypitaya
7
+ spec:
8
+ replicas: 1
9
+ selector:
10
+ matchLabels:
11
+ app: rubypitaya
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: rubypitaya
16
+ spec:
17
+ containers:
18
+ - name: rubypitaya
19
+ image: git.topfreegames.com:4567/prestes/tech-prototype/rubypitaya:latest
20
+ command: ["bundle", "exec", "rubypitaya", "run"]
21
+ ports:
22
+ - containerPort: 4567
23
+ name: rubypitaya
24
+ env:
25
+ - name: SERVER_NAME
26
+ value: "rubypitaya"
27
+ - name: RUBYPITAYA_ENV
28
+ value: "production"
29
+ - name: NATS_URL
30
+ value: "nats://nats.default.svc.cluster.local:4222"
31
+ - name: ETCD_URL
32
+ value: "http://etcd.default.svc.cluster.local:2379"
33
+ - name: ETCD_PREFIX
34
+ value: "rubypitaya/"
35
+ - name: ETCD_LEASE_SECONDS
36
+ value: "60"
37
+ - name: REDIS_URL
38
+ value: "redis://redis.default.svc.cluster.local:6379"
39
+ - name: DATABASE_HOST
40
+ value: "postgres.default.svc.cluster.local"
41
+ - name: DATABASE_USER
42
+ value: "postgres"
43
+ - name: DATABASE_PASSWORD
44
+ value: "postgres"
45
+ - name: DATABASE_NAME
46
+ value: "ruby_pitaya"
47
+ imagePullSecrets:
48
+ - name: gitlab-registry
@@ -0,0 +1,11 @@
1
+ apiVersion: v1
2
+ kind: PersistentVolumeClaim
3
+ metadata:
4
+ name: postgres-pvc
5
+ spec:
6
+ accessModes:
7
+ - ReadWriteOnce
8
+ resources:
9
+ requests:
10
+ storage: 5Gi
11
+ storageClassName: standard
@@ -0,0 +1,12 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: connector
5
+ spec:
6
+ selector:
7
+ app: connector
8
+ ports:
9
+ - protocol: TCP
10
+ port: 3250
11
+ targetPort: 3250
12
+ type: LoadBalancer
@@ -0,0 +1,17 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: etcd
5
+ spec:
6
+ selector:
7
+ app: etcd
8
+ ports:
9
+ - protocol: TCP
10
+ port: 2379
11
+ targetPort: 2379
12
+ name: etcd-2379
13
+ - protocol: TCP
14
+ port: 2380
15
+ targetPort: 2380
16
+ name: etcd-2380
17
+ type: LoadBalancer
@@ -0,0 +1,12 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: nats
5
+ spec:
6
+ selector:
7
+ app: nats
8
+ ports:
9
+ - protocol: TCP
10
+ port: 4222
11
+ targetPort: 4222
12
+ type: LoadBalancer
@@ -0,0 +1,12 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: postgres
5
+ spec:
6
+ selector:
7
+ app: postgres
8
+ ports:
9
+ - protocol: TCP
10
+ port: 5432
11
+ targetPort: 5432
12
+ type: LoadBalancer
@@ -0,0 +1,13 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: redis
5
+ spec:
6
+ selector:
7
+ app: redis
8
+ ports:
9
+ - protocol: TCP
10
+ port: 6379
11
+ targetPort: 6379
12
+ name: redis
13
+ type: LoadBalancer
@@ -0,0 +1,12 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: rubypitaya
5
+ spec:
6
+ selector:
7
+ app: rubypitaya
8
+ ports:
9
+ - protocol: TCP
10
+ port: 80
11
+ targetPort: 4567
12
+ type: LoadBalancer
@@ -0,0 +1,25 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: etcd
5
+ labels:
6
+ app: etcd
7
+ spec:
8
+ serviceName: "etcd"
9
+ replicas: 1
10
+ selector:
11
+ matchLabels:
12
+ app: etcd
13
+ template:
14
+ metadata:
15
+ labels:
16
+ app: etcd
17
+ spec:
18
+ containers:
19
+ - name: etcd
20
+ image: appcelerator/etcd:3.0.15
21
+ ports:
22
+ - containerPort: 2379
23
+ name: etcd-2379
24
+ - containerPort: 2380
25
+ name: etcd-2380
@@ -0,0 +1,23 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: nats
5
+ labels:
6
+ app: nats
7
+ spec:
8
+ serviceName: "nats"
9
+ replicas: 1
10
+ selector:
11
+ matchLabels:
12
+ app: nats
13
+ template:
14
+ metadata:
15
+ labels:
16
+ app: nats
17
+ spec:
18
+ containers:
19
+ - name: nats
20
+ image: nats:2.1.4
21
+ ports:
22
+ - containerPort: 4222
23
+ name: nats
@@ -0,0 +1,37 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: postgres
5
+ labels:
6
+ app: postgres
7
+ spec:
8
+ serviceName: "postgres"
9
+ replicas: 1
10
+ selector:
11
+ matchLabels:
12
+ app: postgres
13
+ template:
14
+ metadata:
15
+ labels:
16
+ app: postgres
17
+ spec:
18
+ containers:
19
+ - name: postgres
20
+ image: postgres:9.6.17
21
+ env:
22
+ - name: POSTGRES_USER
23
+ value: "postgres"
24
+ - name: POSTGRES_PASSWORD
25
+ value: "postgres"
26
+ - name: PGDATA
27
+ value: "/var/lib/postgresql/data/pgdata"
28
+ ports:
29
+ - containerPort: 5432
30
+ name: postgres
31
+ volumeMounts:
32
+ - name: postgres
33
+ mountPath: /var/lib/postgresql/data
34
+ volumes:
35
+ - name: postgres
36
+ persistentVolumeClaim:
37
+ claimName: postgres-pvc
@@ -0,0 +1,23 @@
1
+ apiVersion: apps/v1
2
+ kind: StatefulSet
3
+ metadata:
4
+ name: redis
5
+ labels:
6
+ app: redis
7
+ spec:
8
+ serviceName: "redis"
9
+ replicas: 1
10
+ selector:
11
+ matchLabels:
12
+ app: redis
13
+ template:
14
+ metadata:
15
+ labels:
16
+ app: redis
17
+ spec:
18
+ containers:
19
+ - name: redis
20
+ image: redis:6.0.5-alpine
21
+ ports:
22
+ - containerPort: 6379
23
+ name: redis
@@ -25,6 +25,7 @@ module RubyPitaya
25
25
  'pool': config['pool'],
26
26
  'host': config['host'],
27
27
  'user': config['user'],
28
+ 'password': config['password'],
28
29
  'database': config['database'],
29
30
  }
30
31
  end
@@ -36,6 +37,7 @@ module RubyPitaya
36
37
  'pool': config['pool'],
37
38
  'host': config['host'],
38
39
  'user': config['user'],
40
+ 'password': config['password'],
39
41
  }
40
42
  end
41
43
 
@@ -1,3 +1,3 @@
1
1
  module RubyPitaya
2
- VERSION = "1.5.0"
2
+ VERSION = "1.7.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubypitaya
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luciano Prestes Cavalcanti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-30 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -211,6 +211,20 @@ files:
211
211
  - "./lib/rubypitaya/app-template/docker/entrypoint.sh"
212
212
  - "./lib/rubypitaya/app-template/docker/prod/Dockerfile"
213
213
  - "./lib/rubypitaya/app-template/docker/prod/Makefile"
214
+ - "./lib/rubypitaya/app-template/kubernetes/README.md"
215
+ - "./lib/rubypitaya/app-template/kubernetes/deployment-connector.yaml"
216
+ - "./lib/rubypitaya/app-template/kubernetes/deployment-rubypitaya.yaml"
217
+ - "./lib/rubypitaya/app-template/kubernetes/persistent-volume.yaml"
218
+ - "./lib/rubypitaya/app-template/kubernetes/service-connector.yaml"
219
+ - "./lib/rubypitaya/app-template/kubernetes/service-etcd.yaml"
220
+ - "./lib/rubypitaya/app-template/kubernetes/service-nats.yaml"
221
+ - "./lib/rubypitaya/app-template/kubernetes/service-postgres.yaml"
222
+ - "./lib/rubypitaya/app-template/kubernetes/service-redis.yaml"
223
+ - "./lib/rubypitaya/app-template/kubernetes/service-rubypitaya.yaml"
224
+ - "./lib/rubypitaya/app-template/kubernetes/statefulset-etcd.yaml"
225
+ - "./lib/rubypitaya/app-template/kubernetes/statefulset-nats.yaml"
226
+ - "./lib/rubypitaya/app-template/kubernetes/statefulset-postgres.yaml"
227
+ - "./lib/rubypitaya/app-template/kubernetes/statefulset-redis.yaml"
214
228
  - "./lib/rubypitaya/core/application_files_importer.rb"
215
229
  - "./lib/rubypitaya/core/config.rb"
216
230
  - "./lib/rubypitaya/core/database_config.rb"