Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): Add e2e tests against latest docker images #22576

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6634641
Enable whole summary upload
alexvy86 Sep 16, 2024
37f3bc3
Make all other settings the same with r11s in AKS
alexvy86 Sep 16, 2024
f637360
Remove use of docker-compose.dev.yml file
alexvy86 Sep 16, 2024
3e14cc4
Add missing redirect from alfred to nexus in local docker env.
alexvy86 Sep 16, 2024
30b1293
Trying out running e2e tests against docker in the pipeline
alexvy86 Sep 16, 2024
e512c35
Undo changes to config.json
alexvy86 Sep 16, 2024
4445af3
Restore use of docker-compose.dev.yml
alexvy86 Sep 16, 2024
63a489c
Conditional env
alexvy86 Sep 17, 2024
6e2cd6a
Add project name
alexvy86 Sep 17, 2024
1ed3e81
Checkout
alexvy86 Sep 17, 2024
2bc9332
Syntax
alexvy86 Sep 17, 2024
89ff3bb
Pass checkout true
alexvy86 Sep 17, 2024
0a6a9b4
Try using built images from ACR
alexvy86 Sep 17, 2024
801bf93
Re-arrange
alexvy86 Sep 17, 2024
9eea008
Use actual env: section
alexvy86 Sep 17, 2024
9d6ecc0
Auth to contaitner registry
alexvy86 Sep 17, 2024
4ea8aa2
Move variable group
alexvy86 Sep 17, 2024
ff9a22a
Try hardcoding service connection name
alexvy86 Sep 17, 2024
24f4164
Add display name
alexvy86 Sep 17, 2024
470d825
Use correct image tags for gitrest and gitssh
alexvy86 Sep 17, 2024
65084b4
Skip additionalDockerComposeFiles
alexvy86 Sep 17, 2024
36d5ff6
Restore use of docker-compose.dev.yml
alexvy86 Sep 17, 2024
ccf8c42
Fix reference to docker compose files
alexvy86 Sep 17, 2024
aeef294
Use nginx directly in the main docker compose file and stop using the…
alexvy86 Sep 17, 2024
a00697b
Whole summary upload by default in the server config
alexvy86 Sep 19, 2024
2f91a31
Make non-routerlicious images configurable
alexvy86 Sep 19, 2024
698dbbe
Use x64 architecture instead of arm
alexvy86 Sep 19, 2024
67eacd7
Use the in-repo routerlicious config in docker env
alexvy86 Sep 19, 2024
a5c84f2
Remove repo checkout for e2e tests
alexvy86 Sep 19, 2024
04acba6
Uncomment other stages
alexvy86 Sep 19, 2024
7411c26
Merge branch 'main' into ff-docker-e2e-tests
alexvy86 Sep 19, 2024
af8b197
Remove deleted parameter
alexvy86 Sep 20, 2024
71bc40b
Add dependency on the e2e_docker stage
alexvy86 Sep 20, 2024
a44d8b9
Revert "Remove repo checkout for e2e tests"
alexvy86 Sep 20, 2024
18a1ae0
Pass parameter again
alexvy86 Sep 20, 2024
21fcbc7
Merge branch 'main' into ff-docker-e2e-tests
alexvy86 Oct 1, 2024
16d7a1a
Cleanup
alexvy86 Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
services:
proxy:
platform: linux/amd64/v3
image: nginx:latest
depends_on:
- "alfred"
- "historian"
- "nexus"
volumes:
- ./routerlicious/nginx.conf:/etc/nginx/nginx.conf
ports:
- "3003:3003"
- "3002:3002"
- "3001:3001"
alfred:
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/server:${ALFRED_IMAGE_TAG:-latest}
ports:
- "3003:3000"
expose:
- "3000"
command: node packages/routerlicious/dist/alfred/www.js
environment:
- DEBUG=fluid:*
- NODE_ENV=development
- IS_FLUID_SERVER=true
restart: always
# THIS VOLUMES IS FOR LOCAL TESTING, IT SHOULD NOT GET MERGED
volumes:
- ./routerlicious/packages/routerlicious/config/config.json:/usr/src/server/packages/routerlicious/config/config.json
Comment on lines +25 to +27
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used this locally to validate running e2e tests against the latest server image, but with whole summary upload enabled (the image itself doesn't do it). This will go away before merging.

nexus:
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/server:${ALFRED_IMAGE_TAG:-latest}
ports:
- "3002:3000"
expose:
- "3000"
command: node packages/routerlicious/dist/nexus/www.js
environment:
- DEBUG=fluid:*
Expand Down Expand Up @@ -63,15 +79,17 @@ services:
restart: always
historian:
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/historian:${HISTORIAN_IMAGE_TAG:-latest}
ports:
- "3001:3000"
expose:
- "3000"
environment:
- DEBUG=fluid:*
- NODE_ENV=development
- IS_FLUID_SERVER=true
# volumes:
# - ./routerlicious/packages/routerlicious/config/config.json:/home/node/server/packages/routerlicious/config.json
Comment on lines +88 to +89
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove too, this was also for local testing.

restart: always
gitrest:
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/gitrest:${HISTORIAN_IMAGE_TAG:-latest}
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/gitrest:${GITREST_IMAGE_TAG:-latest}
environment:
- DEBUG=fluid:*
- NODE_ENV=development
Expand All @@ -80,7 +98,7 @@ services:
- git:/home/node/documents
restart: always
git:
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/gitssh:${HISTORIAN_IMAGE_TAG:-latest}
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/gitssh:${GITSSH_IMAGE_TAG:-latest}
ports:
- "3022:22"
volumes:
Expand Down
7 changes: 4 additions & 3 deletions server/routerlicious/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
proxy:
platform: linux/amd64/v3
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
Expand Down Expand Up @@ -105,7 +106,7 @@ services:
- IS_FLUID_SERVER=true
restart: always
historian:
image: mcr.microsoft.com/fluidframework/routerlicious/historian:latest
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/historian:${HISTORIAN_IMAGE_TAG:-latest}
expose:
- "3000"
environment:
Expand All @@ -114,7 +115,7 @@ services:
- IS_FLUID_SERVER=true
restart: always
gitrest:
image: mcr.microsoft.com/fluidframework/routerlicious/gitrest:latest
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/gitrest:${GITREST_IMAGE_TAG:-latest}
environment:
- DEBUG=fluid:*
- NODE_ENV=development
Expand All @@ -123,7 +124,7 @@ services:
- git:/home/node/documents
restart: always
git:
image: mcr.microsoft.com/fluidframework/routerlicious/gitssh:latest
image: ${REGISTRY_URL:-mcr.microsoft.com}/fluidframework/routerlicious/gitssh:${GITSSH_IMAGE_TAG:-latest}
ports:
- "3022:22"
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"endpoint": "zookeeper:2181"
},
"storage": {
"enableWholeSummaryUpload": false,
"enableWholeSummaryUpload": true,
"ephemeralDocumentTTLSec": 86400,
"storageUrl": "http://gitrest:3000"
},
Expand Down
18 changes: 16 additions & 2 deletions tools/pipelines/templates/include-test-real-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ parameters:
type: boolean
default: false

- name: preSteps
type: stepList
default: []

- name: checkout
type: boolean
default: false

stages:
- stage: ${{ parameters.stageId}}
displayName: ${{ parameters.stageDisplayName }}
Expand Down Expand Up @@ -154,8 +162,12 @@ stages:

steps:
# Setup
- checkout: none
clean: true
- ${{ if eq(parameters.checkout, true) }}:
- checkout: self
clean: true
- ${{ else }}:
- checkout: none
clean: true

# Install self-signed cert for R11s deployment in local cert store
- ${{ if ne(parameters.r11sSelfSignedCertSecureFile, '') }}:
Expand Down Expand Up @@ -209,6 +221,8 @@ stages:

- template: include-use-node-version.yml

- ${{ parameters.preSteps }}

# Download artifact
- task: DownloadPipelineArtifact@2
displayName: Download test package
Expand Down
76 changes: 75 additions & 1 deletion tools/pipelines/test-real-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pr: none

resources:
pipelines:
- pipeline: client # Name of the pipeline resource
- pipeline: client
source: Build - client packages
branch: main # Default branch for manual/scheduled triggers if none is selected
trigger:
Expand All @@ -19,6 +19,18 @@ resources:
- main
- next
- lts
- pipeline: routerlicious
source: server-routerlicious
branch: main # Default branch for manual/scheduled triggers if none is selected
- pipeline: historian
source: server-historian
branch: main # Default branch for manual/scheduled triggers if none is selected
- pipeline: gitrest
source: server-gitrest
branch: main # Default branch for manual/scheduled triggers if none is selected
- pipeline: gitssh
source: server-gitssh
branch: main # Default branch for manual/scheduled triggers if none is selected

variables:
- group: prague-key-vault
Expand Down Expand Up @@ -103,6 +115,68 @@ stages:
fluid__test__driver__r11s: $(automation-fluid-test-driver-r11s)
FLUID_TEST_LOGGER_PKG_PATH: ${{ variables.testWorkspace }}/node_modules/@ff-internal/aria-logger # Contains getTestLogger impl to inject

# end-to-end tests docker
- template: templates/include-test-real-service.yml
parameters:
stageId: e2e_docker
stageDisplayName: e2e - docker
poolBuild: Large
testPackage: ${{ variables.testPackage }}
testWorkspace: ${{ variables.testWorkspace }}
artifactBuildId: $(resources.pipeline.client.runID)
continueOnError: true
testCommand: test:realsvc:r11s:docker
checkout: true
stageVariables:
- group: container-registry-info
splitTestVariants:
- name: Non-compat
flags: --compatVersion=0
- name: N-1
flags: --compatVersion=-1
- name: LTS
flags: --compatVersion=LTS
- name: Cross-Version
flags: --compatVersion=CROSS_VERSION
cacheCompatVersionsInstalls: true
uploadTestPassRateTelemetry: true
pipelineIdentifierForTelemetry: ${{ variables.pipelineIdentifierForTelemetry }}
preSteps:
- task: Docker@2
displayName: 'Login to container registry'
inputs:
# $(containerRegistryConnection) comes from the container-registry-info variable group and needs to be
# specified as a runtime variable (variables from variable groups apparently are never available "statically"
# at parse/compile time, so can't be used with template-expression syntax ( '${{ }}' )).
containerRegistry: 'Fluid Container Registry' # $(containerRegistryConnection)
command: 'login'
- task: DockerCompose@1
displayName: 'Start routerlicious environment in docker'
inputs:
containerregistrytype: 'Container Registry'
dockerComposeFile: 'server/docker-compose.yml'
action: 'Run a Docker Compose command'
dockerComposeCommand: 'up -d'
projectName: 'routerlicious'
env:
REGISTRY_URL: fluidcr.azurecr.io/build
ALFRED_IMAGE_TAG: 0.0.$(resources.pipeline.routerlicious.runID)
HISTORIAN_IMAGE_TAG: 0.0.$(resources.pipeline.historian.runID)
GITREST_IMAGE_TAG: 0.0.$(resources.pipeline.gitrest.runID)
GITSSH_IMAGE_TAG: 0.0.$(resources.pipeline.gitssh.runID)
additionalSteps:
- task: DockerCompose@1
displayName: 'Stop routerlicious environment in docker'
condition: always()
inputs:
containerregistrytype: 'Container Registry'
dockerComposeFile: 'server/docker-compose.yml'
action: 'Run a Docker Compose command'
dockerComposeCommand: 'down'
projectName: 'routerlicious'
env:
FLUID_TEST_LOGGER_PKG_PATH: ${{ variables.testWorkspace }}/node_modules/@ff-internal/aria-logger # Contains getTestLogger impl to inject

# end-to-end tests frs
- template: templates/include-test-real-service.yml
parameters:
Expand Down
Loading