-
Notifications
You must be signed in to change notification settings - Fork 0
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
QA testing in CI/CD #35
Conversation
There seems to be a problem with symlinks and the artifacts so right now i'm setting things up in a way to avoid them. |
Progress! Looks like we can share the built executables using the artifacts and test them in different OSes in separate runners for each job. right now I've gotten windows, Linux and application builds working. macos I need access to use so i'll look into that. How we share the artifacts is by specifying a artifact path for the job with
and obtaining them in the test job with
|
Just a note, I had to disable the version and .json test while working on this. |
I'm looking into this now. |
I'm adding back the |
Due to MatrixAI/Polykey#4, we don't have access to macos in this repo. So for now we will just remove these CI/CD jobs. |
@tegefaulkes you also said that |
Currently:
So now to test |
And so the problem is apparent.
|
Nix build now works. It appears the problem is because The master's
While the version required by the dependencies is:
So by updating our This ends up bringing in Furthermore we have to |
Ok it appears it's because So one solution is to pin the dev dependency of
In It may not be safe to downgrade the |
Long-term question is The dev dependencies are now:
And this allows us to be careful with what is working and what is not. Anyway I've reverted the change to |
Also note that because we now require
Into This ensures that
This has to be done for |
Note that Because currently the By default all artifacts are built, but we can specify specific dependencies with Details are all here: https://docs.gitlab.com/ee/ci/yaml/#dependencies Anyway I believe since we are currently using stages instead of DAG: https://docs.gitlab.com/ee/ci/directed_acyclic_graph/ So we can remove the |
Recommend in the future we do something like this:
This makes it easier to always push up to the cicd instead of waiting for the mirroring. |
The script:
- image="$(docker load --input ./builds/*docker* | cut -d' ' -f3)"
- docker run "$image" Important to note that Note that the configuration for docker runs with TLS enabled. According to the docs https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#docker-in-docker-with-tls-disabled if we don't control the runner configuration we may need to use non-TLS. However the TLS version currently works with no errors. So I'll keep it as is. I asked a question about this here: https://stackoverflow.com/questions/39608736/docker-in-docker-with-gitlab-shared-runner-for-building-and-pushing-docker-image#comment123832664_39608823 |
I have a build failure on The And the
When this is copied into the builds directory and then packaged up. This symlink is being saved. And therefore when it is later unpacked into the This is why when we ask it to execute We could change the Therefore if we want to test the resulting application build, we have to instead build the "closure" and export that closure to a Nix-capable system for them to run. Example of this: # put this into our artifacts
nix-store --export $(nix-store -qR ./result) > ./tmp/test.closure
# put this into the testing system...
nix-store --import ./tmp/test.closure Note that nix-store -qR gets all the nix store paths required
Alternatively one can just test the resulting build in the same job that builds them, because doing the above would only be testing if the nix copy closure is working properly. See: https://nixos.org/manual/nix/unstable/package-management/copy-closure.html |
So now I'm outputting the closure into the artifact. One must be careful with this, since closure is reaching 262 MiB for typescript-demo-lib as it contains everything. It could be further helped by compression. The resulting size reduces down to 83 MiB. We can pipe in the compression when copying closures there. |
Ok last problem is that the linux run is failing. I had changed to using an image |
Turns out the official alpine image is too small. It doesn't even have bash. https://stackoverflow.com/questions/40944479/docker-how-to-use-bash-with-an-alpine-based-docker-image. I wonder where it is attempting to run |
Ideally the execution on for f in ./builds/*-linux-*; do "$f"; done This ensures that it runs each executable one at a time. Right now the globbing might end up acquiring multiple files. I would add this right now, but I would need to find out how powershell can do a similar for loop as that's what is being used in the windows script. If someone has a powershell they can see how to do a for loop that can glob and acquire a list of items to execute within the loop. Apparently something like this could work: Get-ChildItem -File ./builds/*-win32-* | Foreach {$_.fullname} |
Linux build is working finally on ubuntu latest. So it indeed seems that alpine doesn't have bash. Also I'm not sure where "bash" is being required by the package. Maybe |
Resulting builds are here: https://gitlab.com/MatrixAI/open-source/typescript-demo-lib/-/jobs/1804270635/artifacts/browse/builds/ |
Future windows related work should take note of what's available on the windows system: https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers/blob/main/cookbooks/preinstalled-software/README.md |
…e.json usage in application release
a0e9c60
to
a3b21e4
Compare
Description
This PR is for testing a QA stage in the Gitlab CI/CD for testing the packaged executables in different environments.
Tasks
runDocker.sh
and embed that in.gitlab-ci.yml
figure out how to do command substitutionnix-build
works locally on NixOS/nix-shell environmentFinal checklist