Closed frenzymadness closed 1 year ago
Python: https://github.com/sclorg/s2i-python-container/pull/545 Postgre: https://github.com/sclorg/postgresql-container/pull/465 Varnish: https://github.com/sclorg/varnish-container/pull/105
This PR has to be merged first and then we can update the submodule in the other repositories. [test]
It looks good to me. But would it be possible to add some test suite?
Do you mean some unit tests for the functions in the generator module? Or do you want something more complex?
@frenzymadness I have tried to run the new generate on PR https://github.com/sclorg/s2i-python-container/pull/546 by command make generate-new
and the result of git status
is:
deleted: src/rhel
typechange: test/check_imagestreams.py
deleted: test/imagestreams
typechange: test/test-lib-openshift.sh
typechange: test/test-lib.sh
typechange: test/test-openshift.yaml
The original is:
$ ls -la src/rhel
lrwxr-xr-x 1 phracek staff 6 Jan 6 2022 src/rhel -> centos
$ ls -la test/imagestreams
lrwxr-xr-x 1 phracek staff 16 Jan 6 2022 test/imagestreams -> ../imagestreams/
$
It looks like the symlinks disappeared.
I would say everything ;) but we can start with unit tests :)
@frenzymadness I have tried to run the new generate on PR sclorg/s2i-python-container#546 by command
make generate-new
and the result ofgit status
is:deleted: src/rhel typechange: test/check_imagestreams.py deleted: test/imagestreams typechange: test/test-lib-openshift.sh typechange: test/test-lib.sh typechange: test/test-openshift.yaml
The original is:
$ ls -la src/rhel lrwxr-xr-x 1 phracek staff 6 Jan 6 2022 src/rhel -> centos $ ls -la test/imagestreams lrwxr-xr-x 1 phracek staff 16 Jan 6 2022 test/imagestreams -> ../imagestreams/ $
It looks like the symlinks disappeared.
I cannot reproduce it. I have fetched the branch you have opened the PR from (support_cvp_pipeline
) and ran make generate-new
and there is nothing in git status. The generator should change nothing in src and test folders so there is something strange happening on your machine. Could you please paste the full output of the command here?
I have copied this PR to s2i-python-container and sources are generated properly. I forgot to copy your pull request. Sorry.
@frenzymadness Please rebase it against the master
Rebased
[test-all]
@frenzymadness could you please look at the tests results for RHEL8, postresql-container[1]?
The generator fails on invalid syntax:
common/generator.py -v $version -m manifest.yml -s specs/multispec.yml ; \
fi \
done
File "common/generator.py", line 70
if m := re.match(r".*\.rhel(\d+)$", filename):
^
SyntaxError: invalid syntax
[1] http://artifacts.osci.redhat.com/testing-farm/dbf739df-b662-460b-bfec-7d80a4d4d2df/
@frenzymadness could you please look at the tests results for RHEL8, postresql-container[1]?
The generator fails on invalid syntax:
Yeah, thanks, I have to fix that. The walrus operator is available in Python 3.8+ but the default Python in RHEL 8 is 3.6.
[test-all]
I'm investigating Testing Farm - RHEL8 - postgresql-container
– the error says ModuleNotFoundError: No module named 'yaml'
which is strange because distgen itself depends on yaml (and imports it) so if the distgen is there (which should be, right?) then an importable yaml module should be there as well. But I have no idea how is the distgen installed there.
It seems that the result (the log) of Python container on RHEL 8 is incomplete.
It seems that the result (the log) of Python container on RHEL 8 is incomplete.
The full log can be found here[1]. Testing Farm prints only first n lines of log output to the main webpage with results. But there is always a link to the directory with all test artifacts on the upper part of the webpage.
I'm investigating
Testing Farm - RHEL8 - postgresql-container
– the error saysModuleNotFoundError: No module named 'yaml'
which is strange because distgen itself depends on yaml (and imports it) so if the distgen is there (which should be, right?) then an importable yaml module should be there as well. But I have no idea how is the distgen installed there.
Installation of distgen (and other needed packages) is done by the TMT (from the TMT plan). The package should be installed from Fedora or epel repositories. I am however not sure, what can be the source of this error. I will need to take closer look.
Installation of distgen (and other needed packages) is done by the TMT (from the TMT plan). The package should be installed from Fedora or epel repositories. I am however not sure, what can be the source of this error. I will need to take closer look.
Thank you. My assumption was that distgen depends on pyyaml so it's safe to use it also for the new generator.
[test-all]
Just to summarize new discoveries and what we agreed on at a meeting last week.
The current situation is that some container images regenerate versioned folders before the build phase. That's the reason we need to install distgen everywhere. The problems are:
make generate
) is not used everywhere by default but it depends on a container image itself. For example Python container image does not regenerate its content before built, but in postgres it's implemented in a hacky way by overloading a make target from common scripts. Nonetheless, it's a bad idea to regenerate versioned folders before build because then what we ship to registries is different from what we have in git repositories.We have agreed that nobody will really use the generator on Python 2 and if a request to support Centos 7 appears, we can either provide a workaround (install distgen into a virtual env for Python 3) or we can start building distgen for Python 3 in EPEL.
The plan is to remove the hacks from postgre and varnish and introduce a new step into GH actions. The new step will do the following:
make generate
Cc @zmiklank @phracek @pkubatrh
To be more specific, we can follow these steps:
I'm not sure we'll be able to prepare and test everything in advance so I'd not wait for all PRs to be ready.
@zmiklank @phracek @pkubatrh what do you think about my plan?
Oh yes, I agree
@phracek how far we are with https://github.com/sclorg/container-common-scripts/pull/275? Do you think we should use this PR as a check within the GitHub Action, or is better, from your point of view, to write something new? If you do not have time for that I could do that.
I'm gonna proceed with the plan now. I'll merge this, update common submodules and merge the linked PRs in the container images' repos.
This replaces the black Makefile magic and the complicated shell generator with a much simpler Python script. I'm gonna open pull requests for container images where we use distgen to show the results the new generator provides.