ci: Ship source maps + fix perf test failures on EE (#18700)

* - Add missing env variables to fix perf tests failures in EE

* - Delete source maps on CI only for EE

* - Add the additional steps that might be required for running perf tests on EE

* Update if condition

* Update if condition

* Switch to bash from using sh in build.sh

* Check if the server started later

* Update the check to see if the server has started

Co-authored-by: Satish Gandham <hello@satishgandham.com>
This commit is contained in:
Satish Gandham 2022-12-09 18:40:59 +05:30 committed by GitHub
parent 9f0b9ee94b
commit 03703ff044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 29 deletions

View File

@ -602,20 +602,17 @@ jobs:
# Run the server in the background and redirect logs to a log file
./scripts/start-dev-server.sh &> server-logs.log &
- name: Wait for 30 seconds for server to start
- name: Wait for 30s and check if server is running
if: steps.run_result.outputs.run_result != 'success'
run: |
sleep 30s
- name: Exit if Server hasnt started
if: steps.run_result.outputs.run_result != 'success'
run: |
if [[ `ps -ef | grep "server-.*-SNAPSHOT" | grep java |wc -l` == 0 ]]; then
echo "Server Not Started";
exit 1;
else
echo "Server Found";
fi
if lsof -i :8080; then
echo "Server Found"
else
echo "Server Not Started. Printing logs from server process"
cat app/server/nohup.out
exit 1
fi
- name: Installing Yarn serve
if: steps.run_result.outputs.run_result != 'success'

View File

@ -126,6 +126,43 @@ jobs:
name: build
path: app/server/dist
- name: Download the rts build artifact
uses: actions/download-artifact@v2
with:
name: rts-dist
path: app/rts/dist
- name: Untar the rts folder
run: |
tar -xvf app/rts/dist/rts-dist.tar -C app/rts/
echo "Cleaning up the tar files"
rm app/rts/dist/rts-dist.tar
# We don't use Depot Docker builds because it's faster for local Docker images to be built locally.
# It's slower and more expensive to build these Docker images on Depot and download it back to the CI node.
- name: Build docker image
if: steps.run_result.outputs.run_result != 'success'
working-directory: "."
run: |
docker build -t fatcontainer .
- name: Create folder
if: steps.run_result.outputs.run_result != 'success'
env:
APPSMITH_LICENSE_KEY: ${{ secrets.APPSMITH_LICENSE_KEY }}
working-directory: "."
run: |
mkdir -p fatcontainerlocal/stacks/configuration/
mkdir -p fatcontainerlocal/oldstack
- name: Download S3 image
uses: keithweaver/aws-s3-github-action@v1.0.0
with:
command: cp
source: s3://ci-assets--appsmith/
destination: /home/runner/work/appsmith/appsmith/fatcontainerlocal/oldstack
aws_access_key_id: ${{ secrets.S3_CI_ASSETS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.S3_CI_ASSETS_SECRET_ACCESS_KEY }}
aws_region: ap-south-1
flags: --recursive
# Start server
- name: start server
if: steps.run_result.outputs.run_result != 'success'
@ -140,6 +177,8 @@ jobs:
APPSMITH_CLOUD_SERVICES_USERNAME: ""
APPSMITH_CLOUD_SERVICES_PASSWORD: ""
APPSMITH_GIT_ROOT: "./container-volumes/git-storage"
APPSMITH_LICENSE_KEY: ${{ secrets.APPSMITH_LICENSE_KEY }}
APPSMITH_ENVFILE_PATH: /tmp/dummy.env
run: |
ls -l
ls -l scripts/
@ -147,21 +186,6 @@ jobs:
# Run the server in the background and redirect logs to a log file
./scripts/start-dev-server.sh &> server-logs.log &
- name: Wait for 30 seconds for server to start
if: steps.run_result.outputs.run_result != 'success'
run: |
sleep 30s
- name: Exit if Server hasnt started
if: steps.run_result.outputs.run_result != 'success'
run: |
if [[ `ps -ef | grep "server-.*-SNAPSHOT" | grep java |wc -l` == 0 ]]; then
echo "Server Not Started";
exit 1;
else
echo "Server Found";
fi
- name: Installing Yarn serve
if: steps.run_result.outputs.run_result != 'success'
run: |
@ -179,7 +203,13 @@ jobs:
docker run --name test-event-driver -d -p 2222:22 -p 5001:5001 -p 3306:3306 \
-p 5432:5432 -p 28017:27017 -p 25:25 --privileged --pid=host --ipc=host --volume /:/host -v ~/git-server/keys:/git-server/keys \
-v ~/git-server/repos:/git-server/repos appsmith/test-event-driver:latest
cd fatcontainerlocal
docker run -d --name appsmith -p 80:80 -p 9001:9001 \
-v "$PWD/stacks:/appsmith-stacks" -e APPSMITH_LICENSE_KEY=$APPSMITH_LICENSE_KEY \
-e APPSMITH_AUDITLOG_ENABLED=true \
-e APPSMITH_CLOUD_SERVICES_BASE_URL=http://host.docker.internal:5001 \
fatcontainer
- name: Setting up the perf tests
if: steps.run_result.outputs.run_result != 'success'
shell: bash
@ -230,6 +260,17 @@ jobs:
shell: bash
run: yarn install --frozen-lockfile
- name: Exit if Server hasnt started
if: steps.run_result.outputs.run_result != 'success'
run: |
if lsof -i :8080; then
echo "Server Found"
else
echo "Server Not Started. Printing logs from server process"
cat app/server/nohup.out
exit 1
fi
- name: Change test script permissions
if: steps.run_result.outputs.run_result != 'success'
working-directory: app/client/perf

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e
@ -8,5 +8,11 @@ echo "Sentry Auth Token: $SENTRY_AUTH_TOKEN"
REACT_APP_SENTRY_RELEASE=$GIT_SHA REACT_APP_CLIENT_LOG_LEVEL=ERROR EXTEND_ESLINT=true craco --max-old-space-size=4096 build --config craco.build.config.js
rm ./build/static/js/*.js.map
if [ "$GITHUB_REPOSITORY" == "appsmithorg/appsmith-ee" ]; then
echo "Deleting sourcemaps for EE"
rm ./build/static/js/*.js.map
rm ./build/static/js/*.js.map.gz
fi
echo "build finished"