-
Notifications
You must be signed in to change notification settings - Fork 11
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
Reproducible builds #6
Reproducible builds #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @tarilabs for the idea of automating the build and making it reproducible!
Added just some comments/doubt below
README.md
Outdated
@@ -2,7 +2,7 @@ | |||
A go based server that implements a gRPC interface for [ml_metadata](https://github.com/google/ml-metadata/) library. | |||
It adds other features on top of the functionality offered by the gRPC interface. | |||
## Pre-requisites: | |||
- go >= 1.19 | |||
- go >= 1.20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we change this, shouldn't we change the go version in go.mod
as well?
Apart from this, is it fine to have precondition on go >= 1.20
or for some reason should we keep 1.19
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not reproduce with Go 1.19, so I would say this must bump or else the code which is already checked in is actually broken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I think the issue was during this installation: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
(or maybe not just this one) so if for some reason we need to keep 1.19
we might think to set older dependency version instead of latest
.
Another question is: is it safe to use the latest
version for those deps? I do not know how fast Go world is going so we might be in the same situation sooner if they keep releasing new versions (not backward compatible) frequently. Maybe this is not the right moment for this discussion :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the "latest" I believe we can keep as-is for the time being, and to get started with. We can always improve on that later (and separate PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the code doesn't really work with 1.19, I'd prefer to have a version bump change in another commit so we can refer to it as a separate bugfix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the code doesn't really work with 1.19, I'd prefer to have a version bump change in another commit so we can refer to it as a separate bugfix.
it was, but code-policy requires squashed commit, and reproducible build is the subject here (including, in this case, the version bump)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with changes from @lampajr . As far as we can, we should try and support the last 3 go releases, which is 1.19, since 1.21 is the latest right now.
Makefile
Outdated
deps: | ||
go install github.com/99designs/gqlgen@latest | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add the go-enum
dependency here as well as per Andrea's note on #3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but depending on which PR gets in first, we will rebase/modify accordingly.
Makefile
Outdated
.PHONY: deps | ||
deps: | ||
go install github.com/99designs/gqlgen@latest | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this conflicts with the new instructions from #4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but depending on which PR gets in first, we will rebase/modify accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you separate the version bump (as commit [1/4]), from the gitignore changes (as commit [2/4]), add the new Makefile rules (as commit [3/4]), and then finally add the CI? This way we can keep nice atomic changes.
Also, as mentioned in my comment on #3 we should stick to git's commit conventions.
For some reason I couldn't find a CI run on your branch, can you provide a link to a successful run with the suggested build.yml
?
Either way, nice work here, let's keep project maintenance in check :)
no i cannot. as explained code policy wants PR with squashed commits 🤷
see above, the squashed commit text respects the result of that once squashed
I linked it in the original description:
|
Hmm, about the code policy, does that make sense? I wouldn't say so, as it's a lot easier to keep atomic changes. Either way, I interpret it differently: "the commits are squashed" as in you aren't making a change then fixing it in an upcoming commit in the same series -- so we don't have to refer to multiple changes for a single atomic modification. EDIT: A little thought experiment: if we were to squash all commits in every PR, then we'd either get massive changes on most PRs or we'd have to separate everything in multiple PRs, either way, this isn't helpful at all for reviews or for the project history.
Sorry, I missed that, my bad. |
I am empathic with this, but on other hand I don't make the rules 😬
No worries. |
f5d6f6a
to
42cc1b4
Compare
rebased to account for #4 |
42cc1b4
to
38ae620
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, we can add more checks like uncommitted code check in another PR.
README.md
Outdated
@@ -2,7 +2,7 @@ | |||
A go based server that implements a gRPC interface for [ml_metadata](https://github.com/google/ml-metadata/) library. | |||
It adds other features on top of the functionality offered by the gRPC interface. | |||
## Pre-requisites: | |||
- go >= 1.19 | |||
- go >= 1.20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with changes from @lampajr . As far as we can, we should try and support the last 3 go releases, which is 1.19, since 1.21 is the latest right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestion, moreover I tried to run the workflow locally but it keeps failing for this:
:error::Failed to run: Error: failed to get action config: connect ENETUNREACH 2606:50c0:8002::154:443, Error: failed to get action config: connect ENETUNREACH 2606:50c0:8002::154:443%0A at getConfig (/run/act/actions/golangci-golangci-lint-action@v3/dist/run/index.js:67135:15)%0A at process.processTicksAndRejections (node:internal/process/task_queues:95:5)%0A at async findLintVersion (/run/act/actions/golangci-golangci-lint-action@v3/dist/run/index.js:67156:20)%0A at async prepareLint (/run/act/actions/golangci-golangci-lint-action@v3/dist/run/index.js:66704:27)%0A at async prepareEnv (/run/act/actions/golangci-golangci-lint-action@v3/dist/run/index.js:66765:22)
It seems something related to the golangci-lint action but I did not find yet the root cause.
4e642f1
to
771483c
Compare
To highlight why I was suggesting not to check-in to version-control the generated files, the check fails because anyone might have a slightly different environment: diff --git a/internal/ml_metadata/proto/metadata_store.pb.go b/internal/ml_metadata/proto/metadata_store.pb.go
index 0d89cd2..ee2d0db 100644
--- a/internal/ml_metadata/proto/metadata_store.pb.go
+++ b/internal/ml_metadata/proto/metadata_store.pb.go
@@ -16,7 +16,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
-// protoc v3.20.3
+// protoc v4.24.2
// source: ml_metadata/proto/metadata_store.proto
package proto
diff --git a/internal/ml_metadata/proto/metadata_store_service.pb.go b/internal/ml_metadata/proto/metadata_store_service.pb.go
index fadd1ce..64ef5ef 100644
--- a/internal/ml_metadata/proto/metadata_store_service.pb.go
+++ b/internal/ml_metadata/proto/metadata_store_service.pb.go
@@ -16,7 +16,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
-// protoc v3.20.3
+// protoc v4.24.2
// source: ml_metadata/proto/metadata_store_service.proto
package proto
diff --git a/internal/ml_metadata/proto/metadata_store_service_grpc.pb.go b/internal/ml_metadata/proto/metadata_store_service_grpc.pb.go
index cd3945f..7661927 100644
--- a/internal/ml_metadata/proto/metadata_store_service_grpc.pb.go
+++ b/internal/ml_metadata/proto/metadata_store_service_grpc.pb.go
@@ -16,7 +16,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
-// - protoc v3.20.3
+// - protoc v4.24.2
// source: ml_metadata/proto/metadata_store_service.proto
package proto |
.gitignore
Outdated
@@ -3,3 +3,4 @@ | |||
model-registry | |||
metadata.sqlite.db | |||
vendor | |||
.DS_Store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I appreciate this as a Mac user, you should probably ignore that in your ~/.gitignore file (or the project's local .git/info/exclude)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most the projects I've worked on put this in the project's .gitignore
so that doesn't "expect" contributors to have additional local-setup (say someone raise a PR, is likely they might not notice this slips-in).
Example:
- https://github.com/quarkusio/quarkus/blob/main/.gitignore#L1
- https://github.com/apache/camel/blob/main/.gitignore#L6
With the idea is that you make the life easier for any contributors.
But seems to me this is what is preferred to the group, acting on it 👍
I definitely agree with you. We should only make it easy to regen those. I still haven't tried my hand at that though, do we have any reasons to avoid it? |
We want to make sure the binaries generated are exactly the same using exactly the same tools. This is especially important when eventually this becomes a managed service. So we should have a
And make these tools dependencies of other targets like gen/* for example.
And lock down the tool versions to ensure repeatability. @tarilabs if you wish you can do it in this PR, or I can create another PR if you are tired of working on this. 😄 |
I'll approve once it's properly rebased and commits are looking good. Even if we're squashing everything the description wouldn't make any sense as is rn. |
83b2f5c
to
afb8e8a
Compare
1. use makefile to automate deps install 2. setup basic GHA to ensure makefile build is reproducible
afb8e8a
to
f2d9469
Compare
PR reworked per f2d9469 description and externalized "uncommitted changes check" to be dealt later in opendatahub-io/model-registry#16 |
on no-veto(s) remaining, and neutral or approved reviews, proceeding to merge. |
Merge model registry codebase from https://github.com/opendatahub-io/model-registry
use makefile to automate deps install
the .gitignore did not account for file relocations from 97d4c5f
deleted: pkg/ml_metadata/proto/metadata_store.pb.go
deleted: pkg/ml_metadata/proto/metadata_store_service.pb.go
deleted: pkg/ml_metadata/proto/metadata_store_service_grpc.pb.go
bump Go version:
GHA for protoc installation per requirements
Description
.gitignore
How Has This Been Tested?
see https://github.com/tarilabs/model-registry/actions/runs/6247075284/job/16958971408
Merge criteria: