Skip to content

Commit 904ed6e

Browse files
committed
Merge branch 'deploymentToMerge'
2 parents 1bf4733 + 11e1709 commit 904ed6e

32 files changed

+10451
-15601
lines changed

docker/Makefile

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
.PHONY: start
44
start: build
55
# starts the entire runtime infrastructure
6-
docker-compose up -d ssl
6+
docker compose up -d ssl
77

88
.PHONY: dev
99
dev: start
10-
docker-compose up -d ui-builder
10+
docker compose up -d ui-builder
1111

1212
.PHONY: playwright-tests
1313
playwright-tests:
1414

15+
# stop any containers that are running
16+
docker compose down
17+
1518
# delete any cached session storage state files if the service isn't running
1619
docker compose ps app-for-playwright > /dev/null 2>&1 || rm -f ../*-storageState.json
1720

18-
docker-compose up -d app-for-playwright
21+
docker compose up -d app-for-playwright
1922

2023
# wait until the app-for-playwright service is serving up HTTP before continuing
2124
until curl localhost:3238 > /dev/null 2>&1; do sleep 1; done
@@ -24,32 +27,32 @@ playwright-tests:
2427

2528
.PHONY: e2e-tests
2629
e2e-tests:
27-
docker-compose build app-for-e2e test-e2e
28-
docker-compose restart app-for-e2e || docker-compose up -d app-for-e2e
29-
docker-compose run -e TEST_SPECS=$(TEST_SPECS) test-e2e
30+
docker compose build app-for-e2e test-e2e
31+
docker compose restart app-for-e2e || docker compose up -d app-for-e2e
32+
docker compose run -e TEST_SPECS=$(TEST_SPECS) test-e2e
3033

3134
.PHONY: e2e-tests-ci
3235
e2e-tests-ci:
33-
docker-compose build app-for-e2e test-e2e
34-
docker-compose run -e GITHUB_ACTIONS=1 --name e2etests test-e2e
36+
docker compose build app-for-e2e test-e2e
37+
docker compose run -e GITHUB_ACTIONS=1 --name e2etests test-e2e
3538
docker cp e2etests:/data/e2e-output/junitresults.xml e2e-results.xml
3639
docker rm e2etests
3740

3841
.PHONY: unit-tests
3942
unit-tests:
40-
docker-compose build test-php
41-
docker-compose run test-php
43+
docker compose build test-php
44+
docker compose run test-php
4245

4346
.PHONY: unit-tests-ci
4447
unit-tests-ci:
45-
docker-compose run --name unittests test-php
48+
docker compose run --name unittests test-php
4649
docker cp unittests:/var/www/PhpUnitTests.xml .
4750
docker rm unittests
4851

4952
.PHONY: build
5053
build:
5154
npm install
52-
docker-compose build mail app lfmerge ld-api next-proxy next-app
55+
docker compose build mail app lfmerge ld-api next-proxy next-app
5356

5457
.PHONY: scan
5558
# https://docs.docker.com/engine/scan
@@ -68,14 +71,14 @@ build-next:
6871

6972
.PHONY: clean
7073
clean:
71-
docker-compose down
74+
docker compose down
7275
docker system prune -f
7376

7477
.PHONY: clean-volumes
7578
clean-volumes:
76-
docker-compose down -v
79+
docker compose down -v
7780
docker system prune -f --volumes
7881

7982
.PHONY: clean-powerwash
8083
clean-powerwash: clean-volumes
81-
docker-compose down --rmi all
84+
docker compose down --rmi all

docker/deployment/app-deployment.yaml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,6 @@ spec:
6565
labels:
6666
app: app
6767
spec:
68-
affinity:
69-
# required to ensure this container makes it to lfmerge's dedicated node
70-
nodeAffinity:
71-
preferredDuringSchedulingIgnoredDuringExecution:
72-
- preference:
73-
matchExpressions:
74-
- key: dedicated
75-
operator: In
76-
values:
77-
- lfmerge
78-
weight: 1
79-
# required to ensure this container makes it to lfmerge's dedicated node
80-
tolerations:
81-
- effect: NoSchedule
82-
key: dedicated
83-
operator: Equal
84-
value: lfmerge
8568
volumes:
8669
- name: assets
8770
persistentVolumeClaim:
@@ -92,6 +75,11 @@ spec:
9275
initContainers:
9376
- name: initialize-volume-ownership
9477
image: busybox:1.33
78+
resources:
79+
requests:
80+
memory: 25Mi
81+
limits:
82+
memory: 50Mi
9583
command:
9684
- 'sh'
9785
- '-c'
@@ -107,6 +95,13 @@ spec:
10795
- name: app
10896
image: sillsdev/web-languageforge:{{VERSION}}
10997
imagePullPolicy: Always
98+
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
99+
resources:
100+
requests:
101+
memory: 110Mi
102+
cpu: 0.1
103+
limits:
104+
memory: 200Mi
110105
volumeMounts:
111106
- mountPath: /var/www/html/assets
112107
name: assets

docker/deployment/db-deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ spec:
5050
containers:
5151
- name: db
5252
image: mongo:4.0
53+
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
54+
resources:
55+
requests:
56+
memory: 260Mi
57+
cpu: 0.1
58+
limits:
59+
memory: 400Mi
5360
volumeMounts:
5461
- mountPath: /data/db
5562
name: data

docker/deployment/lfmerge-deployment.yaml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ spec:
6666
app: lfmerge
6767
spec:
6868
affinity:
69-
# required to ensure this container makes it to a dedicated node (so it doesn't crash other containers when it blows up)
70-
nodeAffinity:
71-
preferredDuringSchedulingIgnoredDuringExecution:
72-
- preference:
73-
matchExpressions:
74-
- key: dedicated
75-
operator: In
76-
values:
77-
- lfmerge
78-
weight: 1
7969
# need to keep this on the same pod as the app since inotify only gets notification when updates occur on the same kernel
8070
podAffinity:
8171
requiredDuringSchedulingIgnoredDuringExecution:
@@ -86,19 +76,19 @@ spec:
8676
values:
8777
- app
8878
topologyKey: kubernetes.io/hostname
89-
# required to ensure this container makes it to a dedicated node (so it doesn't crash other containers when it blows up)
90-
tolerations:
91-
- effect: NoSchedule
92-
key: dedicated
93-
operator: Equal
94-
value: lfmerge
9579
volumes:
9680
- name: sendreceive-data
9781
persistentVolumeClaim:
9882
claimName: lfmerge-sendreceive-data
9983
initContainers:
10084
- name: initialize-volume-ownership
10185
image: busybox:1.33
86+
resources:
87+
requests:
88+
memory: 25Mi
89+
cpu: 0.1
90+
limits:
91+
memory: 50Mi
10292
command:
10393
- 'sh'
10494
- '-c'
@@ -112,6 +102,13 @@ spec:
112102
- name: lfmerge
113103
image: ghcr.io/sillsdev/lfmerge:{{VERSION_LFMERGE}}
114104
imagePullPolicy: Always
105+
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
106+
resources:
107+
requests:
108+
memory: 120Mi
109+
cpu: 0.25
110+
limits:
111+
memory: 2.5Gi
115112
volumeMounts:
116113
- mountPath: /var/lib/languageforge/lexicon/sendreceive
117114
name: sendreceive-data

docker/deployment/mail-deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ spec:
3232
containers:
3333
- name: mail
3434
image: juanluisbaptiste/postfix:1.0.0
35+
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
36+
resources:
37+
requests:
38+
memory: 30Mi
39+
cpu: 0.1
40+
limits:
41+
memory: 100Mi
3542
env:
3643
- name: SERVER_HOSTNAME
3744
value: {{SERVER_HOSTNAME}}

docker/deployment/next-app-deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ spec:
3939
- name: next-app
4040
image: sillsdev/web-languageforge:{{VERSION}}
4141
imagePullPolicy: Always
42+
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
43+
resources:
44+
requests:
45+
memory: 16Mi
46+
cpu: 0.1
47+
limits:
48+
memory: 20Mi
4249
env:
4350
- name: API_HOST
4451
value: http://app

docker/deployment/next-proxy-deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,14 @@ spec:
6565
containers:
6666
- name: next-proxy
6767
image: sillsdev/web-languageforge:{{VERSION}}
68+
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
6869
imagePullPolicy: Always
70+
resources:
71+
requests:
72+
memory: 12Mi
73+
cpu: 0.1
74+
limits:
75+
memory: 20Mi
6976
env:
7077
- name: LEGACY_APP
7178
value: app:80

docker/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ services:
329329
- "host.docker.internal:host-gateway"
330330
volumes:
331331
- ../test/e2e/utils/TestControl.php:/var/www/src/Api/Service/TestControl.php
332+
- ../test/e2e/shared-files:/tmp/e2e-shared-files
332333

333334
test-php:
334335
build:

docker/test-php/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
cd /var/www/
44

55
# optionally add `--filter nameOfTestYouWantToRun`
6+
# where the test name is the class name of the test group e.g. LexEntryModelTest
67
src/vendor/bin/phpunit --configuration test/php/phpunit.xml --log-junit PhpUnitTests.xml

docs/DEVELOPER.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Welcome! We're glad that you are interested in helping develop Language Forge.
44

55
## Development Environment Quick Start ##
66

7-
1. Install [Docker](https://www.docker.com/get-started) (Linux users will need some additional steps, please visit https://docs.docker.com/compose/install for info on installing the engine and compose)
8-
1. Install [Make](https://www.gnu.org/software/make/). This is actually optional but simplifies things a bit.
9-
1. Install [Node 16.14.0](https://nodejs.org/en/download/). We recommend using a Node version manager e.g. [nvm](https://github.com/nvm-sh/nvm#installation-and-update)
10-
1. Clone the repo: `git clone https://github.com/sillsdev/web-languageforge`
11-
1. `cd web-languageforge/docker`
7+
1. Install [Docker](https://www.docker.com/get-started). Linux users will need some additional steps: Please visit https://docs.docker.com/compose/install for info on installing the engine and compose. Windows users, use Ubuntu and follow these instructions -- https://docs.docker.com/engine/install/ubuntu/ -- and then, to permit specific users (and not just "sudo") to contact the Docker daemon, run `sudo usermod -aG docker $yourUsername` and `sudo chmod 666 /var/run/docker.sock`.
8+
3. Install [Make](https://www.gnu.org/software/make/). This is actually optional but simplifies things a bit.
9+
4. Install [Node 16.14.0](https://nodejs.org/en/download/). We recommend using a Node version manager e.g. [nvm](https://github.com/nvm-sh/nvm#installation-and-update)
10+
5. Clone the repo: `git clone https://github.com/sillsdev/web-languageforge`
11+
6. `cd web-languageforge/docker`
1212

1313
### Running the App Locally
1414

@@ -32,6 +32,11 @@ Welcome! We're glad that you are interested in helping develop Language Forge.
3232
>
3333
> NOTE: disabling cache on your device may not be trivial, you'll either need to wipe the site settings on your device's browser or you'll need to do it via USB debugging.
3434
35+
### Running Playwright E2E Tests
36+
37+
1. `make playwright-tests`
38+
2. Test results will appear in your terminal
39+
3540
### Running Protractor E2E Tests
3641
3742
1. `make e2e-tests` (⚠️ these do not work on Apple Silicon at this time)

0 commit comments

Comments
 (0)