Skip to content

Commit

Permalink
Merge branch 'main' into testing/activity_logger
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood committed Oct 6, 2022
2 parents 531fb7b + 6794ece commit 89a078d
Show file tree
Hide file tree
Showing 40 changed files with 1,036 additions and 998 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pipeline {
parallel {
stage ('1: run first test suite') {
steps {
sh script: "make -j$NPROC kind/retest TESTS=[api,deploytarget,active-standby-kubernetes,features-kubernetes,features-kubernetes-2,features-api-variables,tasks] BRANCH_NAME=${SAFEBRANCH_NAME}", label: "Running first test suite on kind cluster"
sh script: "make -j$NPROC kind/retest TESTS=[api,deploytarget,active-standby-kubernetes,features-kubernetes,features-kubernetes-2,features-variables,tasks] BRANCH_NAME=${SAFEBRANCH_NAME}", label: "Running first test suite on kind cluster"
sh script: "pkill -f './local-dev/stern'", label: "Closing off test-suite-1 log after test completion"
}
}
Expand Down
53 changes: 4 additions & 49 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,40 +98,6 @@ docker_pull:
docker images --format "{{.Repository}}:{{.Tag}}" | grep -E '$(UPSTREAM_REPO)' | grep -E '$(UPSTREAM_TAG)' | xargs -tn1 -P8 docker pull -q || true;
grep -Eh 'FROM' $$(find . -type f -name *Dockerfile) | grep -Ev '_REPO|_VERSION|_CACHE' | awk '{print $$2}' | sort --unique | xargs -tn1 -P8 docker pull -q

#######
####### Base Images
#######
####### Base Images are the base for all other images and are also published for clients to use during local development

images := athenapdf-service \
docker-host

# base-images is a variable that will be constantly filled with all base image there are
base-images += $(images)
s3-images += $(images)

# List with all images prefixed with `build/`. Which are the commands to actually build images
build-images = $(foreach image,$(images),build/$(image))

# Define the make recipe for all base images
$(build-images):
# Generate variable image without the prefix `build/`
$(eval image = $(subst build/,,$@))
# Call the docker build
$(call docker_build,$(image),images/$(image)/Dockerfile,images/$(image))
#scan created image with Trivy
$(call scan_image,$(image),)
# Touch an empty file which make itself is using to understand when the image has been last build
touch $@

# Define dependencies of Base Images so that make can build them in the right order. There are two
# types of Dependencies
# 1. Parent Images, like `build/centos7-node6` is based on `build/centos7` and need to be rebuild
# if the parent has been built
# 2. Dockerfiles of the Images itself, will cause make to rebuild the images if something has
# changed on the Dockerfiles
build/docker-host: images/docker-host/Dockerfile
build/athenapdf-service:images/athenapdf-service/Dockerfile

#######
####### Service Images
Expand All @@ -142,9 +108,9 @@ build/athenapdf-service:images/athenapdf-service/Dockerfile
# Yarn Workspace Image which builds the Yarn Workspace within a single image. This image will be
# used by all microservices based on Node.js to not build similar node packages again
build-images += yarn-workspace-builder
build/yarn-workspace-builder: images/yarn-workspace-builder/Dockerfile
build/yarn-workspace-builder: yarn-workspace-builder/Dockerfile
$(eval image = $(subst build/,,$@))
$(call docker_build,$(image),images/$(image)/Dockerfile,.)
$(call docker_build,$(image),$(image)/Dockerfile,.)
$(call scan_image,$(image),)
touch $@

Expand Down Expand Up @@ -182,12 +148,8 @@ services := api \
broker \
broker-single \
controllerhandler \
drush-alias \
keycloak \
keycloak-db \
logs-concentrator \
logs-dispatcher \
logs-tee \
logs2notifications \
storage-calculator \
webhook-handler \
Expand All @@ -212,12 +174,8 @@ build/api-redis: services/api-redis/Dockerfile
build/actions-handler: services/actions-handler/Dockerfile
build/broker-single: services/broker/Dockerfile
build/broker: build/broker-single
build/drush-alias: services/drush-alias/Dockerfile
build/keycloak-db: services/keycloak-db/Dockerfile
build/keycloak: services/keycloak/Dockerfile
build/logs-concentrator: services/logs-concentrator/Dockerfile
build/logs-dispatcher: services/logs-dispatcher/Dockerfile
build/logs-tee: services/logs-tee/Dockerfile
build/storage-calculator: services/storage-calculator/Dockerfile
build/tests: tests/Dockerfile
build/local-minio:
Expand Down Expand Up @@ -290,9 +248,6 @@ main-test-services = actions-handler broker logs2notifications api api-db api-re
# List of Lagoon Services needed for webhook endpoint testing
webhooks-test-services = webhook-handler webhooks2tasks backup-handler

# List of Lagoon Services needed for drupal testing
drupal-test-services = drush-alias

# All tests that use Webhook endpoints
webhook-tests = github gitlab bitbucket

Expand Down Expand Up @@ -495,7 +450,7 @@ GOJQ_VERSION = v0.12.8
STERN_VERSION = 2.1.20
CHART_TESTING_VERSION = v3.6.0
KIND_IMAGE = kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae
TESTS = [nginx,api,features-kubernetes,bulk-deployment,features-kubernetes-2,features-api-variables,active-standby-kubernetes,tasks,drush,drupal-php80,drupal-postgres,python,gitlab,github,bitbucket,node-mongodb,elasticsearch,workflows]
TESTS = [nginx,api,features-kubernetes,bulk-deployment,features-kubernetes-2,features-variables,active-standby-kubernetes,tasks,drush,drupal-php80,drupal-postgres,python,gitlab,github,bitbucket,node-mongodb,elasticsearch,workflows]
CHARTS_TREEISH = main
TASK_IMAGES = task-activestandby

Expand Down Expand Up @@ -616,7 +571,7 @@ ifeq ($(ARCH), darwin)
tcp-listen:32080,fork,reuseaddr tcp-connect:target:32080
endif

KIND_SERVICES = api api-db api-redis auth-server actions-handler broker controllerhandler docker-host drush-alias keycloak keycloak-db logs2notifications webhook-handler webhooks2tasks local-api-data-watcher-pusher local-git ssh tests workflows $(TASK_IMAGES)
KIND_SERVICES = api api-db api-redis auth-server actions-handler broker controllerhandler keycloak keycloak-db logs2notifications webhook-handler webhooks2tasks local-api-data-watcher-pusher local-git ssh tests workflows $(TASK_IMAGES)
KIND_TESTS = local-api-data-watcher-pusher local-git tests
KIND_TOOLS = kind helm kubectl jq stern

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ services:
command: yarn run dev
environment:
- NODE_ENV=development
- KEYCLOAK_API=http://localhost:8088/auth
- GRAPHQL_API=http://localhost:3000/graphql
ports:
- '8888:3003'
actions-handler:
Expand Down Expand Up @@ -220,9 +222,7 @@ services:
ports:
- '5000:5000'
drush-alias:
image: ${IMAGE_REPO:-lagoon}/drush-alias
volumes:
- ./services/drush-alias/web/aliases.drushrc.php.stub:/app/aliases.drushrc.php.stub
image: uselagoon/drush-alias:latest
ports:
- '8087:8080'
labels:
Expand Down
6 changes: 3 additions & 3 deletions docs/contributing-to-lagoon/developing-lagoon.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ The individual routines relevant to Kubernetes are:
* `drupal-php74` runs a single-pod MariaDB, MariaDB DBaaS and a Drush-specific test for a Drupal 8/9 project \(`drupal-php73` doesn't do the Drush test\).
* `drupal-postgres` runs a single-pod PostgreSQL and a PostgreSQL DBaaS test for a Drupal 8 project.
* `elasticsearch` runs a simple NGINX proxy to an Elasticsearch single-pod.
* `features-api-variables` runs tests that utilize variables in Lagoon.
* `features-variables` runs tests that utilize variables in Lagoon.
* `features-kubernetes` runs a range of standard Lagoon tests, specific to Kubernetes.
* `features-kubernetes-2` runs more advanced kubernetes-specific tests - covering multi-project and subfolder configurations.
* `nginx`, `node` and `python` run basic tests against those project types.
Expand Down Expand Up @@ -213,7 +213,7 @@ Here are some development scenarios and useful workflows for getting things done
#### Add tests

1. Repeat the first step above.
2. Edit `tests/tests/features-api-variables.yaml` and add a test case.
2. Edit `tests/tests/features-variables.yaml` and add a test case.
3. Rebuild the `tests` image.

```bash
Expand All @@ -230,5 +230,5 @@ make kind/push-images IMAGES=tests
1. Rerun the tests.

```bash
make kind/retest TESTS='[features-api-variables]'
make kind/retest TESTS='[features-variables]'
```
31 changes: 0 additions & 31 deletions images/athenapdf-service/Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions images/athenapdf-service/entrypoint.sh

This file was deleted.

43 changes: 0 additions & 43 deletions images/docker-host/Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions images/docker-host/prune-images.sh

This file was deleted.

8 changes: 0 additions & 8 deletions images/docker-host/remove-exited.sh

This file was deleted.

12 changes: 0 additions & 12 deletions images/docker-host/update-images.sh

This file was deleted.

26 changes: 0 additions & 26 deletions images/docker-host/update-push-images.sh

This file was deleted.

2 changes: 2 additions & 0 deletions local-dev/git/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ RUN mkdir -m 700 /git/.ssh && \
git --bare init /git/drush-sa.git && \
git --bare init /git/nginx.git && \
git --bare init /git/features.git && \
git --bare init /git/features-cronjobs.git && \
git --bare init /git/features-subfolder.git && \
git --bare init /git/features-variables.git && \
git --bare init /git/elasticsearch.git && \
git --bare init /git/solr.git && \
git --bare init /git/active-standby.git && \
Expand Down
Loading

0 comments on commit 89a078d

Please sign in to comment.