-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Question] Ci/Cd using AWS Codebuild/Codepipeline #2646
Comments
Thanks for sharing this, and we would be happy to add steps to the docs. One observation on your setup right now:
I would recommend installing playwright as pwuser, instead of root, so that browser binaries are installed in the user profile dir of pwuser and there are no permission issues. We had a similar discussion on this issue thread. Is there a reason you're running npm i playwright as root? |
@arjun27 good call, there wasn't a reason.. I'm going to update it for my build image! |
Thanks @burritoIand - and apologies that I wasn't clear earlier. This is a typical setup that we see for Docker:
Note that only steps 1 and 2 are in the dockerfile. Does this match with how you're thinking? I want to make this simpler to use - and perhaps we could communicate this differently in our docs. Let me know if this makes sense. |
hey @argjun27, what you described makes sense and like I said, I might not be using an optimal set up on aws codebuild. The reason I added playwright installation directly into the build environment image, was so that the ci/cd build step doesn't have to download/install anything and rather it's already set up and available. In my case I have a But that said I have a different process for testing locally where I run So as an alternative I could try mounting the docker image (w/o playright install step), and then run |
Yes, it would. I believe that would also make it simpler to maintain over time, since the Playwright version will only have to be updated in your NPM dependencies. We were just talking about this situation in our team today, and I do believe there is merit in ensuring the build env has Playwright browsers pre-installed. Let's approach this incrementally, starting with publishing the Docker image (#1482) so that it can be used directly. We can then follow up with improvements, like adding browsers to the Docker env. We want to make this easy for users, and I really appreciate this discussion :) |
Hey folks! As of today and as of Playwright v1.3.0, we version our docker image the same way as Playwright, and bake browsers in: docker run --rm -it mcr.microsoft.com/playwright:v1.3.0 /bin/bash Does this cover the needs discussed in the lengthy discussion here? |
Have you guys run this in AWS Codebuild/Codepipeline?
There may be a better way, but what I've found to work currently w/o having to use docker in the codebuild (which is supported), is that I build an image based on the official playwright docker image, then I push the image to AWS Elastic Container Registry (ECR), and in my AWS Cloudformation template that defines the pipeline, I use the custom image for the codebuild environment. This way codebuild already has playwright installed with all 3 browsers etc, and only requires your test files to run, making it run faster etc.
The one downside to this method is that you have to rebuild the docker image whenever you want to upgrade playwright to a new version.
Would it be worth adding more color on this for anyone else? Happy to open a doc pr let me know.
Dockerfile
codepipeline.yml
The text was updated successfully, but these errors were encountered: