Google Cloud
Sorry-cypress installation instructions for Google Cloud Run
The suggested setup uses the following stack:
Google Cloud Run services to run sorry-cypress Director, API and Dashboard
Google Cloud Storage with signed Read and Write URLs
MongoDB setup of your choice
Please make sure that you have
recent version of
gcloud
installedGoogle Cloud project is configured and you have sufficient permissions
recent version of Docker installed
MongoDB Setup
Please use MongoDB provider of your choice. MongoDB Atlas is a simple and popular managed solution that also has a free tier.
Once you've created MongoDB cluster and a database, please obtain credentials and database name, you will need it in subsequent steps.
Storage Setup
You can use AWS S3 Storage instead, please refer to AWS S3 setup instructions
Create Bucket
Navigate to the API Console Storage page
Select a project or create a new project. Note the project ID.
Select Create and follow the steps to create the bucket. Note the bucket name.
Consider setting up a Lifecycle Rule to keep only the most recent objects and keep costs down. Eg: Delete object, 7+ days since object was created
Authentication
Sorry-cypress Director authenticates on Google Cloud Storage using the Service Account assigned on the cloud run revision (usually Compute Engine default service account)
Make sure that service account has the Storage Object Creator
Role, or assign the role / create a new service account with the role instead.
Access Control
By default the google-cloud-storage driver uses Signed URLs for both Read & Write URLs. This means the bucket access can be set to Uniform
- Not Public
However, Google Cloud Storage Signed URLs have a max expiration time of 7 days. If you need to view the recording of your runs from sorry-cypress Dashboard for more than 7 days consider one of the following:
Allow public read access to the bucket
Use MinIO Gateway to access Google Cloud Storage instead. Instructions
Deploying sorry-cypress Kit
Let's create 3 Cloud Run Services and deploy sorry-cypress components. We are going to run the following sequence of commands for each service:
Pull latest docker image from Dockerhub
Tag and push image to GCR associated with your project
Deploy Google Cloud Run service using the newly generated image
Running a simple script hosted on GitHub would deploy the services.
-p
is the current Google Cloud project-n
is the name prefix for generated Google Cloud Run services
Note the URLs of the generated services, we'll use those in the next step to configure the services so they'll be able to communicate one with another.
Configuring sorry-cypress Services
Run the commands below, please be careful while substituting template strings with values obtained at previous steps
🎉 Congratulations!
You've finished setting up sorry-cypress on Google Cloud - now you can open the Dashboard URL to see the dashboard.
Don't forget to reconfigure cypress agents to use Director service before running test.
Last updated