Open midnightconman opened 1 year ago
After a little more digging, it seems the image digest is available from the outputs of the oci_image
rule, in index.json
. Here is an example:
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
"manifests": [
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1895,
"digest": "sha256:397573c2b94603f08933c692ad919aafd185fec73c45c2d6b20f837753977913"
}
]
}
+1 - from a scan of this repo I don't see a good reason that it depends on rules_docker at all. I think it should just be properly layered to know nothing about how you construct your images.
@midnightconman FYI, the output of oci_image
is always going to be a directory artifact that follows the layout specified by the OCI image-spec
https://github.com/opencontainers/image-spec/blob/main/image-layout.md
That should give us a reliable way to parse the index.json
file since we know its media type: application/vnd.oci.image.index.v1+json
Any success here getting the k8s rule to work with oci_image? I switched from the docker rules because of go dependency problems, but now broke my local development pipeline.
Sorry, no success because this repo appears to be totally unmaintained, after trying in a few ways I haven't been able to reach anyone. Likely it's going to be archived.
@alexeagle is there any chance we might see an aspect-build/rules_k8s one day?
I doubt it, unless we find some funding from the community or from one of our clients.
We've been modelling the CI/CD handoff as Continuous Delivery rather than Continuous Deployment: "Bazel has to create artifacts and deliver them somewhere, a different tool then picks them up and promotes them to the next environment dev/staging/prod" https://docs.aspect.build/v/workflows/delivery and when modeled that way, something that can do a k8s deploy is on the "other side of the fence".
Of course that's not a reason that something like rules_k8s shouldn't exist, it's just less urgent for us to jump in and drive.
As rules_docker is no longer maintained and has some lingering multi-arch issues... we switched to the new
rules_oci
for image packaging and distribution. It seems that the default resolver doesn't like the new package format for image tarballs (via ruleoci_tarball
). We get the following error when trying to run rules_k8s targets:Here is an example of our bazel build file:
I am going to try and create a custom resolver to parse the new
manifest.json
created by rules_oci... but it would be nice if the default resolver supported these new rules.Here is an example of a new
manifest.json
(which is part of the oci_tarball output):Links: