Closed goern closed 3 years ago
@goern: GitHub didn't allow me to assign the following users: larsks.
Note that only thoth-station members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. For more information please see the contributor guide
The existing pre-commit images are based on images from the s2i-thoth repository. If we want a f34/py39 based pre-commit image, do we need to start with f34-py39
image in s2i-thoth
?
it will be there in few mins , we are releasing it
The existing pre-commit images set $HOME
to /opt/app-root/src
, which is presumably where one is expected to mount the source tree to be checked. This is a bad default, since it means anything that normally gets installed in $HOME
gets installed into the source tree, which can have unintended side effects (this is a particularly problem with Go, because it will by default install dependencies into ~/go
, so running go test ./...
in the source tree will pick up unit tests for all the dependencies).
When running on a local system, changes in /opt/app-root/src
impact the local build environment, since the source tree is bind-mounted into the image.
We need make $HOME
different from the source tree.
I guess the easiest option is just to mount the sources somewhere else at runtime, e.g.:
docker run -v $PWD:/src -w /src ...
What is the behaviour implemented by s2i-go ?
I haven't the foggiest idea. Taking a look at https://github.com/sclorg/golang-container now...
The go s2i image sets HOME to /opt/app-root/src, but the Dockerfile generated by s2i build --as-dockerfile ...
copies sources into /tmp/src
and runs the build from there:
pushd /tmp/src
[...]
go build -o /opt/app-root/gobinary
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
/close
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten
@sesheta: Closing this issue.
Let's merge https://github.com/larsks/opf-go-precommit and thoth-precommit from https://github.com/thoth-station/thoth-ops-infra in one container image, so that we can have a unified pre-commit job (for example https://github.com/thoth-station/slo-reporter/blob/master/.prow.yaml#L2-L13) for python or golang source
seeAlso https://operatefirst.slack.com/archives/C01RF4SPNDD/p1622570329014400
/assign @harshad16 /assign @larsks /priority important-soon /sig pipelines /area documentation