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

run in gitlab ci #24

Open
cofiscz opened this issue Dec 26, 2024 · 3 comments
Open

run in gitlab ci #24

cofiscz opened this issue Dec 26, 2024 · 3 comments
Assignees

Comments

@cofiscz
Copy link

cofiscz commented Dec 26, 2024

Hi,
I'm trying to run whole ddev environment including playwright in gitlab ci but it doesn't work. I've tried run it manually on server under the gitlab-runner user and result is the same.
Have you tried to run it in CI? Maybe you have some ideas what could be wrong?

Gitlab Runner Log

$ ddev playwright-install
 Container ddev-ssh-agent  Recreate
 Container ddev-ssh-agent  Recreated
 Container ddev-ssh-agent  Started
ssh-agent container is running: If you want to add authentication to the ssh-agent container, run 'ddev auth ssh' to enable your keys.
Building project images...
...
 Container ddev-cofiscart-db  Recreate
 Container ddev-cofiscart-playwright  Stopped
 Container ddev-cofiscart-web  Recreate
 Container ddev-cofiscart-db  Recreated
 Container ddev-cofiscart-web  Recreated
 Container ddev-cofiscart-playwright  Created
 Container ddev-cofiscart-db  Started
 Container ddev-cofiscart-web  Started
 Container ddev-cofiscart-playwright  Started
Waiting for containers to become ready: [web db]
Starting ddev-router if necessary...
Warning: command 'install_nvm.sh' run as 'blackfire' failed with exit code 1:
You have $NVM_DIR set to "/home/gitlab-runner/.nvm", but that directory does not exist. Check your profile files and environment.
 Container ddev-router  Created
 Container ddev-router  Started
Waiting 900s for additional project containers [ddev-cofiscart-playwright] to become ready...
Failed to start project for custom command: container(s) failed to become healthy before their configured timeout or in 900 seconds.
This might be a problem with the healthcheck and not a functional problem.
The error was 'ddev-cofiscart-playwright container exited.
Troubleshoot this with these commands:
[
	ddev logs -s playwright
	docker logs ddev-cofiscart-playwright
	docker inspect --format "{{ json .State.Health }}" ddev-cofiscart-playwright | docker run -i --rm ddev/ddev-utilities jq -r
]'
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1

ddev logs -s playwright

The local CA is now installed in the system trust store! ⚡️

xauth:  file /home/pwuser/.Xauthority does not exist

New 'cofiscart-playwright:1 (pwuser)' desktop is cofiscart-playwright:1

Users configured:
pwuser (can use keyboard and mouse, add/remove users)

Log file is /home/pwuser/.vnc/cofiscart-playwright:1.log

Starting applications specified in /home/pwuser/.vnc/xstartup
usermod: no changes
The local CA is already installed in the system trust store! 👍


Warning: cofiscart-playwright:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server cofiscart-playwright:1

New 'cofiscart-playwright:2 (pwuser)' desktop is cofiscart-playwright:2

Users configured:
pwuser (can use keyboard and mouse, add/remove users)

Log file is /home/pwuser/.vnc/cofiscart-playwright:2.log

Starting applications specified in /home/pwuser/.vnc/xstartup
Killing Xvnc process ID 37
usermod: no changes
The local CA is already installed in the system trust store! 👍


Warning: cofiscart-playwright:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server cofiscart-playwright:1

New 'cofiscart-playwright:2 (pwuser)' desktop is cofiscart-playwright:2

Users configured:
pwuser (can use keyboard and mouse, add/remove users)

Log file is /home/pwuser/.vnc/cofiscart-playwright:2.log

Starting applications specified in /home/pwuser/.vnc/xstartup
Killing Xvnc process ID 38
@julienloizelet
Copy link
Owner

Hi @cofiscz,
Thanks for your message.

Yes, I use this add-on mainly in CI, but I've never tried it in Gitlab CI, only in GitHub workflows.

For example, this test workflow installs ddev and this add-on, then runs a simple playwright test.

Do you have any public repo where I can see how you install ddev and this add-on with Gitlab CI, so I can try to reproduce the bug ?

If not, I will try anyway (don't know when I will have time for it, but it's an interesting issue).

Looking at your log, it seems like something is going wrong when trying to start the vnc server.
Indeed,
this: Starting applications specified in /home/pwuser/.vnc/xstartup probably happens when the entrypoint run sudo -u pwuser vncserver -fg -disableBasicAuth here.

No idea why it fails at this moment.

Something I have in mind too: this "vnc" feature is probably not needed in CI, I would like to rework on this so that people can disable it; but it's not clear how I could do that.

Perhaps you could try to modify the entrypoint, before running the playwright container for the first time, in order to not run the vnc server.

Maybe something like : sudo -u pwuser vncserver -fg -disableBasicAuth || tail -f /dev/null will keep the container up even if the vnc server fails to start.

Please let me know,

Thanks

@julienloizelet julienloizelet self-assigned this Dec 27, 2024
@cofiscz
Copy link
Author

cofiscz commented Dec 28, 2024

Hi Julien!
thanks for your reply. We use standalone version of gitlab, and I added you as member, so you could have full access to repo. You should recieve an email with invitation link.
I tried to add || tail -f /dev/null but it didn't help. Our gitlab runner uses shell executor, so all commands run directly on server with ddev installed as user gitlab-runner.
When I tried to run container with playwright as gitlab-runner and it stucked on
Starting applications specified in /home/pwuser/.vnc/xstartup
so I had to kill process manually.
Please let me know if I could do something or if could provide you more information.
Thank you

@julienloizelet
Copy link
Owner

Hi @cofiscz,

I can not accept the invitation: Gitlab asks me to login before accepting and I can't register.

By the way, I suggest you to test replacing sudo -u pwuser vncserver -fg -disableBasicAuth with tail -f /dev/null

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants