opensearch-project / opensearch-build

🧰 OpenSearch / OpenSearch-Dashboards Build Systems
Apache License 2.0
140 stars 273 forks source link

[BUG]: Docker images for unreleased version are built and published as released ones (without SNAPSHOT classifier) #5188

Open reta opened 23 hours ago

reta commented 23 hours ago

Describe the bug

As of today, the Docker images for unreleased OpenSearch version (fe 3.0.0, 2.18.1, 2.19.0) are published as released ones, fe for most recent opensearchstaging/opensearch:2.18.1 image:

{
  "name" : "55ffbb67e420",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "Fp3oruNUSByQxuH0sF5L4w",
  "version" : {
    "distribution" : "opensearch",
    "number" : "2.18.1",
    "build_type" : "tar",
    "build_hash" : "1ddb631d77ea96991d3566c54bb7a1be5534fb4a",
    "build_date" : "2024-11-13T01:21:35.441188072Z",
    "build_snapshot" : false,
    "lucene_version" : "9.12.0",
    "minimum_wire_compatibility_version" : "7.10.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "The OpenSearch Project: https://opensearch.org/"
}

To reproduce

$ docker run -p 9200:9200  -e "discovery.type=single-node"  -e OPENSEARCH_INITIAL_ADMIN_PASSWORD=__adm0iN__ opensearchstaging/opensearch:2.18.1

$ curl https://localhost:9200 -kv -u admin:__adm0iN__

Expected behavior

The build_snapshot should have indicated that this is a snapshot build, not a release

Screenshots

If applicable, add screenshots to help explain your problem.

Host / Environment

Any

Additional context

See please https://github.com/opensearch-project/OpenSearch/pull/16581

Relevant log output

No response

reta commented 23 hours ago

@peterzhuamazon would really appreciate your input / help with that, thanks!

peterzhuamazon commented 18 hours ago

This is by design as it is within the opensearchstaging repo, not opensearchproject. Only opensearchproject is the public released official images.

peterzhuamazon commented 18 hours ago

The reason we dont use SNAPSHOT is also by design for everything on ci.opensearch.org as we can quickly make a release candidate become a real release version.

Only the snapshots dir on artifacts.opensearch.org is actually using SNAPSHOT postfix and -Dsnapshot=true parameter as that is more of a leftover in early design choices.

Thanks.

peterzhuamazon commented 18 hours ago

Tho, I am not against having another SNAPSHOT tagged images but those will only have core + core plugins, no other plugins such as knn or alerting.

peterzhuamazon commented 18 hours ago

But I do want to know the use case of this and whether it is necessary.

reta commented 18 hours ago

But I do want to know the use case of this and whether it is necessary.

This is directly related to https://github.com/opensearch-project/opensearch-build/issues/5096:

The plugin installation does not work either, fe installing any plugin in Docker container fails, and for the right reasons - there are no releases for the plugins. And because the build is a release build, the tooling does not look for SNAPSHOTs either.

peterzhuamazon commented 18 hours ago

But I do want to know the use case of this and whether it is necessary.

This is directly related to #5096:

* we publish distribution and plugins as SNAPSHOTs, but ..

* we publish their Docker images as releases

The plugin installation does not work either, fe installing any plugin in Docker container fails, and for the right reasons - there are no releases for the plugins. And because the build is a release build, the tooling does not look for SNAPSHOTs either.

So a SNAPSHOT Min artifact creation followed by a SNAPSHOT docker image creation with only core-plugins core is enough? If that is the case it might be easy to pick up.

reta commented 17 hours ago

So a SNAPSHOT Min artifact creation followed by a SNAPSHOT docker image creation with only core-plugins core is enough?

Do we build Docker images out of SNAPSHOT min distribution? If yes - 100% enough.

peterzhuamazon commented 16 hours ago

So a SNAPSHOT Min artifact creation followed by a SNAPSHOT docker image creation with only core-plugins core is enough?

Do we build Docker images out of SNAPSHOT min distribution? If yes - 100% enough.

Yes, as of now a opensearchstaging/opensearch:3.0.0 will use the distribution build of 3.0.0 tarball to generate an image.

Similarly if we would add another SNAPSHOT image it would have to be built out of min snapshot, which would result into a opensearchstaging/opensearch-min:3.0.0-SNAPSHOT if that make sense to you.

reta commented 16 hours ago

Similarly if we would add another SNAPSHOT image it would have to be built out of min snapshot, which would result into a opensearchstaging/opensearch-min:3.0.0-SNAPSHOT if that make sense to you.

Totally, I think it would be also fair to publish non-released versions as SNAPSHOTs

gaiksaya commented 13 hours ago

I believe these are nightly non-snapshot builds. Similar to what we have even for plugins at ci.opensearch.org. For "SNAPSHOT" version, we would need to build all distributions including tarball (responsible for docker creation) with param SNAPSHOT=true.

As of today we only build min snapshot with SNAPSHOT=true. The reason being arm64 github runners unavailability on GHA. For all independent plugins and opensearch artifacts, snapshot version is build and published to maven using GHA in the respective repos. Wondering if we need to build snapshots at the distribution level.

reta commented 13 hours ago

For "SNAPSHOT" version, we would need to build all distributions including tarball (responsible for docker creation) with param SNAPSHOT=true.

👍 , thanks @gaiksaya , it looks right to me (since we are building the SNAPSHOT versions indeed), the current SNAPSHOT-as-release is quite confusing.