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

Windows Tests via Docker #781

Conversation

bfloch
Copy link
Contributor

@bfloch bfloch commented Oct 30, 2019

This PR includes two fixes for cmd/powershell on windows and requires #775 to succeed future Windows tests.

Currently relying on hub.docker.com as the github service is broken:
https://github.community/t5/GitHub-Actions/Docker-Push-to-Package-Registry-from-Windows/m-p/36393#M2560

Setup Before Merging
(as configured in the PR, feel free to change if needed)

  1. Create a hub.docker.com account matching the github name: nerdvegas.
  2. Create an empty repository called rez-test-win
  3. In hub.docker.com go to Account/Security/New Access Token
    Choose a name (like "Github Access Token") and copy the token
  4. In github, repo settings create a secret DOCKERHUB_TOKEN and paste the TOKEN from docker

Once merged the Compose Windows Docker Image action should run.
The Windows Docker tests will fail at this point, but future pushes should succeed.

In future any required change to the docker image should be a separate PR as documented.
As such the regular actions will not run when only the docker image related files have been touched.
Similarly the image will not be rebuild when none of its files have been touched. Since the image is tagged with the latest revision on these files everything should always be in sync and use the correct images moving forward.

There is some ugliness in the duplication of code throughout the workflow files. GH Actions pros may find better ways to pass the environments instead of recalculating them.

Fingers crossed!

Initially adcac21 added rez to the
systempaths, but this should not be necessary.
It creates failure in tests if rez is not in the systempath, which should
not be a requirement for any shell.

Also conformed the parameters in cmd's and powershell's spawn_shell that
otherwise will end up in Popen_args.
Fresh Windows systems have unexpanded %systemroot% in their PATH variable,
which causes `which()` to fail.
@bfloch
Copy link
Contributor Author

bfloch commented Oct 30, 2019

Quick note: I left cmake out of the docker image.
We could enable it for the future, it was just pretty slow to install during my countless tests.
EDIT: Added it back.

@bfloch bfloch mentioned this pull request Oct 30, 2019
Copy link
Contributor

@instinct-vfx instinct-vfx left a comment

Choose a reason for hiding this comment

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

Seems good to me, still voting to move python into the docker image. But i would not want to let this delay this effort.

@bfloch
Copy link
Contributor Author

bfloch commented Oct 31, 2019

Thanks for the feedback.
I will also enable the cmake install in the Docker image. We're not using it but it's good we have it once we work on the cmake support.

@bfloch
Copy link
Contributor Author

bfloch commented Oct 31, 2019

Please ignore the pushes for a while since I'm testing on this branch on my fork :-/ Sorry for the noise.

@bfloch bfloch force-pushed the feature/windows_action_docker branch from 6c63710 to ca28dfe Compare October 31, 2019 14:29
@bfloch
Copy link
Contributor Author

bfloch commented Oct 31, 2019

Another thing I should check: If the image building and usage is in the same workflow I could express the dependency and we would not need to separate the process into two commits. I'll check if this is possible with github actions. Essentially I would need the 'paths:' checks within a conditional of a step.

@bfloch bfloch force-pushed the feature/windows_action_docker branch 16 times, most recently from 3a7510d to f195429 Compare October 31, 2019 18:07
@bfloch bfloch force-pushed the feature/windows_action_docker branch 3 times, most recently from f7dabea to 040c9ad Compare November 1, 2019 22:29
@bfloch bfloch force-pushed the feature/windows_action_docker branch 10 times, most recently from 735c820 to 7ee59e6 Compare November 4, 2019 16:19
Tests with regular github actions failed (potentially due to overflown PATH
variable), so instead this tries to test via a clean windows docker image.
@bfloch bfloch force-pushed the feature/windows_action_docker branch from 73c6894 to 9f83ddc Compare November 4, 2019 16:53
@bfloch
Copy link
Contributor Author

bfloch commented Nov 4, 2019

History cleaned up. Verified it working. The PR is open again.

@bfloch bfloch force-pushed the feature/windows_action_docker branch from 9f83ddc to 49f89bb Compare November 4, 2019 20:34
Copy link
Member

@JeanChristopheMorinPerso JeanChristopheMorinPerso left a comment

Choose a reason for hiding this comment

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

The docker side looks good to me. Big thanks your work on this :)

@nerdvegas nerdvegas merged commit 49f89bb into AcademySoftwareFoundation:master Nov 6, 2019
@bfloch bfloch mentioned this pull request Nov 6, 2019
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

Successfully merging this pull request may close these issues.

4 participants