Skip to content

Commit 36e751c

Browse files
authored
Merge pull request #54 from ThreeDotsLabs/m1-support
Added support for M1 CPU
2 parents a9b1a1b + edac584 commit 36e751c

14 files changed

Lines changed: 6466 additions & 4189 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ terraform/cloud-builders-community
3131
!/web/src/repositories/clients/users/src/
3232

3333
/service-account-file.json
34+
35+
.go/
36+
.go-cache/

.test.env

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FIRESTORE_EMULATOR_HOST=localhost:8788
22
MYSQL_ADDR=localhost
33

4-
TRAINER_HTTP_ADDR=localhost:5000
5-
TRAINER_GRPC_ADDR=localhost:5010
6-
TRAININGS_HTTP_ADDR=localhost:5001
7-
USERS_HTTP_ADDR=localhost:5002
8-
USERS_GRPC_ADDR=localhost:5020
4+
TRAINER_HTTP_ADDR=localhost:6000
5+
TRAINER_GRPC_ADDR=localhost:6010
6+
TRAININGS_HTTP_ADDR=localhost:6001
7+
USERS_HTTP_ADDR=localhost:6002
8+
USERS_GRPC_ADDR=localhost:6020

docker-compose.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
version: '3'
1+
version: '3.8'
2+
name: 'wild-workouts'
23
services:
34
web:
45
build:
@@ -16,6 +17,8 @@ services:
1617
context: docker/app
1718
volumes:
1819
- ./internal:/internal
20+
- ./.go/pkg:/go/pkg
21+
- ./.go-cache:/go-cache
1922
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
2023
working_dir: /internal/trainer
2124
ports:
@@ -24,6 +27,7 @@ services:
2427
- .env
2528
environment:
2629
SERVER_TO_RUN: http
30+
GOCACHE: /go-cache
2731
depends_on:
2832
- firestore
2933

@@ -32,6 +36,8 @@ services:
3236
context: docker/app
3337
volumes:
3438
- ./internal:/internal
39+
- ./.go/pkg:/go/pkg
40+
- ./.go-cache:/go-cache
3541
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
3642
working_dir: /internal/trainer
3743
ports:
@@ -40,6 +46,7 @@ services:
4046
- .env
4147
environment:
4248
SERVER_TO_RUN: grpc
49+
GOCACHE: /go-cache
4350
depends_on:
4451
- firestore
4552

@@ -48,12 +55,16 @@ services:
4855
context: docker/app
4956
volumes:
5057
- ./internal:/internal
58+
- ./.go/pkg:/go/pkg
59+
- ./.go-cache:/go-cache
5160
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
5261
working_dir: /internal/trainings
5362
ports:
5463
- "127.0.0.1:3001:$PORT"
5564
env_file:
5665
- .env
66+
environment:
67+
GOCACHE: /go-cache
5768
depends_on:
5869
- firestore
5970

@@ -62,12 +73,15 @@ services:
6273
context: docker/app
6374
volumes:
6475
- ./internal:/internal
76+
- ./.go/pkg:/go/pkg
77+
- ./.go-cache:/go-cache
6578
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
6679
working_dir: /internal/users
6780
ports:
6881
- "127.0.0.1:3002:$PORT"
6982
environment:
7083
SERVER_TO_RUN: http
84+
GOCACHE: /go-cache
7185
env_file:
7286
- .env
7387
depends_on:
@@ -78,19 +92,23 @@ services:
7892
context: docker/app
7993
volumes:
8094
- ./internal:/internal
95+
- ./.go/pkg:/go/pkg
96+
- ./.go-cache:/go-cache
8197
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
8298
working_dir: /internal/users
8399
ports:
84100
- "127.0.0.1:3020:$PORT"
85101
environment:
86102
SERVER_TO_RUN: grpc
103+
GOCACHE: /go-cache
87104
env_file:
88105
- .env
89106
depends_on:
90107
- firestore
91108

92109
firestore:
93-
image: karhoo/firestore-emulator:0.3.2
110+
build:
111+
context: docker/firestore-emulator
94112
env_file:
95113
- .env
96114
ports:
@@ -99,15 +117,16 @@ services:
99117
restart: unless-stopped
100118

101119
firestore-component-tests:
102-
image: karhoo/firestore-emulator:0.3.2
120+
build:
121+
context: docker/firestore-emulator
103122
env_file:
104123
- .env
105124
ports:
106125
- "127.0.0.1:8788:8787"
107126
restart: unless-stopped
108127

109128
mysql:
110-
image: mysql:8
129+
image: mariadb:10
111130
env_file:
112131
- .env
113132
volumes:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "threedotslabs-cloudnative"
4+
}
5+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:16.15.0-alpine3.15
2+
3+
RUN apk add --no-cache openjdk8-jre
4+
RUN apk add --no-cache bash
5+
6+
RUN npm install -g firebase-tools@10.9.2
7+
8+
COPY start.sh .
9+
COPY firebase.json .
10+
COPY .firebaserc .
11+
12+
ENTRYPOINT ["./start.sh"]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"emulators": {
3+
"hub": {
4+
"host": "0.0.0.0",
5+
"port": 4400
6+
},
7+
"firestore": {
8+
"host": "0.0.0.0",
9+
"port": 8787
10+
},
11+
"ui": {
12+
"enabled": true,
13+
"host": "0.0.0.0",
14+
"port": 4000
15+
},
16+
"auth": {
17+
"port": 9099,
18+
"host": "0.0.0.0"
19+
}
20+
}
21+
}

docker/firestore-emulator/start.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -xe
3+
4+
firebase emulators:start

docker/web/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM node:13.11.0-alpine3.11
1+
FROM node:12.22.8-alpine3.13
22

33
ENV NODE_ENV development
44

5-
RUN apk add yarn
5+
RUN apk --no-cache add yarn python2 make gcc g++
66
ADD start.sh /
77
RUN chmod +x /start.sh
88

internal/common/server/http.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ func RunHTTPServerOnAddr(addr string, createHandler func(router chi.Router) http
3131

3232
logrus.Info("Starting HTTP server")
3333

34-
_ = http.ListenAndServe(addr, rootRouter)
34+
err := http.ListenAndServe(addr, rootRouter)
35+
if err != nil {
36+
logrus.WithError(err).Panic("Unable to start HTTP server")
37+
}
3538
}
3639

3740
func setMiddlewares(router *chi.Mux) {

internal/trainings/go.sum

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y
7272
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
7373
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
7474
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
75+
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
7576
github.com/getkin/kin-openapi v0.80.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
7677
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
7778
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
@@ -223,8 +224,12 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
223224
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
224225
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
225226
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
227+
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
226228
github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU=
229+
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
230+
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
227231
github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
232+
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
228233
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
229234
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
230235
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -322,6 +327,7 @@ golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY=
322327
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
323328
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
324329
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
330+
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
325331
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
326332
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
327333
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -373,6 +379,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
373379
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
374380
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
375381
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
382+
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
376383
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
377384
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
378385
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -386,6 +393,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w
386393
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
387394
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
388395
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
396+
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
389397
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
390398
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
391399
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -599,6 +607,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
599607
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
600608
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
601609
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
610+
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
602611
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
603612
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
604613
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

0 commit comments

Comments
 (0)