Skip to content
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

[#4072] improvement(docker-image): Transfer docker hub from datastrato to apache #4523

Merged
merged 29 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8160b7f
[#4445] feat(docker): Publish Docker image to Apache official DockerH…
xunliu Aug 8, 2024
730d016
tmp
xunliu Aug 8, 2024
4a27da0
Update docs
xunliu Aug 8, 2024
330d059
Change docker image.
yuqi1129 Aug 14, 2024
ef87a09
test
yuqi1129 Aug 14, 2024
f571c6d
test
yuqi1129 Aug 14, 2024
846d9cc
Fix
yuqi1129 Aug 14, 2024
32e9509
Merge branch 'main' of github.com:datastrato/graviton into issue-4445…
yuqi1129 Aug 14, 2024
63af7d4
Fix
yuqi1129 Aug 14, 2024
6adfa3b
Fix
yuqi1129 Aug 14, 2024
f715e60
Fix
yuqi1129 Aug 15, 2024
d63c68d
Fix
yuqi1129 Aug 15, 2024
d7c926f
Fix
yuqi1129 Aug 15, 2024
5375762
Merge branch 'main' of github.com:datastrato/graviton into issue-4445…
yuqi1129 Aug 15, 2024
54a5a02
Resolve docker naming for Gravitio.
yuqi1129 Aug 15, 2024
cc288c8
Resolve docker naming for Gravitio.
yuqi1129 Aug 15, 2024
9b242e2
Merge branch 'main' of github.com:datastrato/graviton into issue-4445…
yuqi1129 Aug 15, 2024
6a31c1f
Fix
yuqi1129 Aug 15, 2024
4aa1a57
Merge branch 'main' of github.com:datastrato/graviton into issue-4445…
yuqi1129 Aug 16, 2024
fd15a61
Fix comments
yuqi1129 Aug 16, 2024
415df73
Refactor test environment
yuqi1129 Aug 16, 2024
41d2a35
Fix test error.
yuqi1129 Aug 16, 2024
719024b
Fix the version problem.
yuqi1129 Aug 16, 2024
5dd87bc
Change `gravitino-iceberg-rest-server` to `gravitino-iceberg-rest`.
yuqi1129 Aug 16, 2024
6395896
Fix docs in publish-docker-image.jpg
yuqi1129 Aug 16, 2024
53d72bb
Completely replace all docker hub username from `datastrato` to `apache`
yuqi1129 Aug 16, 2024
28de08a
fix
yuqi1129 Aug 17, 2024
0cbcba4
Merge branch 'main' of github.com:datastrato/graviton into issue-4445…
yuqi1129 Aug 19, 2024
acd3da5
fix
yuqi1129 Aug 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cron-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:

jobs:
changes:
if: github.repository == 'datastrato/gravitino'
if: github.repository == 'apache/gravitino'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
79 changes: 49 additions & 30 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@ on:
default: 'gravitino'
options:
- 'gravitino'
- 'gravitino-ci-hive'
- 'gravitino-ci-kerberos-hive'
- 'gravitino-ci-trino'
- 'gravitino-ci-doris'
- 'gravitino-ci-ranger'
- 'gravitino-ci:hive'
- 'gravitino-ci:kerberos-hive'
- 'gravitino-ci:trino'
- 'gravitino-ci:doris'
- 'gravitino-ci:ranger'
- 'gravitino-playground:trino'
- 'gravitino-playground:hive'
- 'gravitino-playground:ranger'
- 'gravitino-iceberg-rest-server'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you update this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the display name in GitHub image actions, I've already updated the final image name. Please refer to line 84.

- 'trino'
- 'hive'
- 'ranger'
tag:
description: 'Docker tag to apply to this image'
version:
description: 'Docker version to apply to this image'
required: true
type: string

username:
description: 'Docker username'
required: true
type: string
token:
Expand All @@ -38,36 +43,45 @@ jobs:
steps:
- name: Set environment variables
run: |
if [ "${{ github.event.inputs.image }}" == "gravitino-ci-hive" ]; then
if [ "${{ github.event.inputs.image }}" == "gravitino-ci:hive" ]; then
echo "image_type=hive" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino-ci-hive" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci-kerberos-hive" ]; then
echo "image_name=apache/gravitino-ci" >> $GITHUB_ENV
echo "tag_name=hive" >> $GITHUB_ENV
mchades marked this conversation as resolved.
Show resolved Hide resolved
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci:kerberos-hive" ]; then
echo "image_type=kerberos-hive" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino-ci-kerberos-hive" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci-trino" ]; then
echo "image_name=apache/gravitino-ci" >> $GITHUB_ENV
echo "tag_name=kerberos-hive" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci:trino" ]; then
echo "image_type=trino" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino-ci-trino" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci-doris" ]; then
echo "image_name=apache/gravitino-ci" >> $GITHUB_ENV
echo "tag_name=trino" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci:doris" ]; then
echo "image_type=doris" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino-ci-doris" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci-ranger" ]; then
echo "image_name=apache/gravitino-ci" >> $GITHUB_ENV
echo "tag_name=doris" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-ci:ranger" ]; then
echo "image_type=ranger" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino-ci-ranger" >> $GITHUB_ENV
echo "image_name=apache/gravitino-ci" >> $GITHUB_ENV
echo "tag_name=ranger" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino" ]; then
echo "image_type=gravitino" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "trino" ]; then
echo "image_name=apache/gravitino" >> $GITHUB_ENV
# `apache/gravitino` is the default image name, didn't need to tag alias name
elif [ "${{ github.event.inputs.image }}" == "gravitino-playground:trino" ]; then
echo "image_type=trino" >> $GITHUB_ENV
echo "image_name=datastrato/trino" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "hive" ]; then
echo "image_name=apache/gravitino-playground" >> $GITHUB_ENV
echo "tag_name=trino" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-playground:hive" ]; then
echo "image_type=hive" >> $GITHUB_ENV
echo "image_name=datastrato/hive" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "ranger" ]; then
echo "image_name=apache/gravitino-playground" >> $GITHUB_ENV
echo "tag_name=hive" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-playground:ranger" ]; then
echo "image_type=ranger" >> $GITHUB_ENV
echo "image_name=datastrato/ranger" >> $GITHUB_ENV
echo "image_name=apache/gravitino-playground" >> $GITHUB_ENV
echo "tag_name=ranger" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.image }}" == "gravitino-iceberg-rest-server" ]; then
echo "image_type=iceberg-rest-server" >> $GITHUB_ENV
echo "image_name=datastrato/gravitino-iceberg-rest-server" >> $GITHUB_ENV
echo "image_name=apache/gravitino-iceberg-rest" >> $GITHUB_ENV
fi

- name: Check publish Docker token
Expand All @@ -83,7 +97,7 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: datastrato
username: ${{ github.event.inputs.username }}
password: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }}

- name: Set up Docker Buildx
Expand All @@ -100,4 +114,9 @@ jobs:
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/hostedtoolcache/CodeQL
./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag ${{ github.event.inputs.tag }} --latest

if [[ "${image_type}" == "gravitino" || "{image_type}" == "iceberg-rest-server" ]]; then
./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag ${{ github.event.inputs.version }} --latest
else
./dev/docker/build-docker.sh --platform all --type ${image_type} --image ${image_name} --tag "${tag_name}-${{ github.event.inputs.version }}"
fi
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cd gravitino

### Development Setup

Once you have cloned the [GitHub repository](https://github.com/apache/gravitino), see [how to build](/docs/how-to-build.md) for instructions on how to build, or you can use the provided docker images at [Datastrato's DockerHub repository](https://hub.docker.com/u/datastrato).
Once you have cloned the [GitHub repository](https://github.com/apache/gravitino), see [how to build](/docs/how-to-build.md) for instructions on how to build, or you can use the provided docker images at [Apache DockerHub repository](https://hub.docker.com/u/apache).

To stop and start a local Gravitino server via `bin/gravitino.sh start` and `bin/gravitino.sh stop` in a Gravitino distribution, see [how to build](/docs/how-to-build.md) for more instructions.

Expand Down
17 changes: 15 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ allprojects {
}
}

val setIntegrationTestEnvironment: (Test) -> Unit = { param ->
val setTestEnvironment: (Test) -> Unit = { param ->
param.doFirst {
param.jvmArgs(project.property("extraJvmArgs") as List<*>)

Expand All @@ -167,6 +167,14 @@ allprojects {
param.environment("HADOOP_HOME", "/tmp")
param.environment("PROJECT_VERSION", project.version)

// Gravitino CI Docker image
param.environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "apache/gravitino-ci:hive-0.1.13")
param.environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "apache/gravitino-ci:kerberos-hive-0.1.5")
param.environment("GRAVITINO_CI_DORIS_DOCKER_IMAGE", "apache/gravitino-ci:doris-0.1.5")
param.environment("GRAVITINO_CI_TRINO_DOCKER_IMAGE", "apache/gravitino-ci:trino-0.1.6")
param.environment("GRAVITINO_CI_RANGER_DOCKER_IMAGE", "apache/gravitino-ci:ranger-0.1.1")
param.environment("GRAVITINO_CI_KAFKA_DOCKER_IMAGE", "apache/kafka:3.7.0")
yuqi1129 marked this conversation as resolved.
Show resolved Hide resolved

val dockerRunning = project.rootProject.extra["dockerRunning"] as? Boolean ?: false
val macDockerConnector = project.rootProject.extra["macDockerConnector"] as? Boolean ?: false
if (OperatingSystem.current().isMacOsX() &&
Expand Down Expand Up @@ -205,7 +213,7 @@ allprojects {
}
}

extra["initIntegrationTest"] = setIntegrationTestEnvironment
extra["initTestParam"] = setTestEnvironment
}

nexusPublishing {
Expand Down Expand Up @@ -409,6 +417,11 @@ subprojects {
}

tasks.configureEach<Test> {
if (project.name != "server-common") {
val initTest = project.extra.get("initTestParam") as (Test) -> Unit
initTest(this)
}

testLogging {
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
Expand Down
8 changes: 0 additions & 8 deletions catalogs/catalog-hadoop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,6 @@ tasks.test {
exclude("**/integration/**")
} else {
dependsOn(tasks.jar)

doFirst {
environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.13")
environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-kerberos-hive:0.1.5")
}

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
init(this)
}
}

Expand Down
8 changes: 0 additions & 8 deletions catalogs/catalog-hive/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,6 @@ tasks.test {
exclude("**/integration/**")
} else {
dependsOn(tasks.jar)

doFirst {
environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.13")
environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-kerberos-hive:0.1.5")
}

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
init(this)
}
}

Expand Down
8 changes: 0 additions & 8 deletions catalogs/catalog-jdbc-doris/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,16 @@ tasks {

tasks.test {
val skipUTs = project.hasProperty("skipTests")
doFirst {
environment("GRAVITINO_CI_DORIS_DOCKER_IMAGE", "datastrato/gravitino-ci-doris:0.1.5")
}

if (skipUTs) {
// Only run integration tests
include("**/integration/**")
}

val skipITs = project.hasProperty("skipITs")
if (skipITs) {
// Exclude integration tests
exclude("**/integration/**")
} else {
dependsOn(tasks.jar)

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
init(this)
}
}

Expand Down
3 changes: 0 additions & 3 deletions catalogs/catalog-jdbc-mysql/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ tasks.test {
exclude("**/integration/**")
} else {
dependsOn(tasks.jar)

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
init(this)
}
}

Expand Down
3 changes: 0 additions & 3 deletions catalogs/catalog-jdbc-postgresql/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ tasks.test {
// PG will use project jdbc-mysql/build/libs directory, so we add the task dependency here.
dependsOn(":catalogs:catalog-jdbc-mysql:jar")
dependsOn(tasks.jar)

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
init(this)
}
}

Expand Down
7 changes: 0 additions & 7 deletions catalogs/catalog-kafka/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,5 @@ tasks.test {
exclude("**/integration/**")
} else {
dependsOn(tasks.jar)

doFirst {
environment("GRAVITINO_CI_KAFKA_DOCKER_IMAGE", "apache/kafka:3.7.0")
}

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
init(this)
}
}
8 changes: 0 additions & 8 deletions catalogs/catalog-lakehouse-iceberg/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ tasks.test {
exclude("**/integration/**")
} else {
dependsOn(tasks.jar)

doFirst {
environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.13")
environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-kerberos-hive:0.1.5")
}

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
init(this)
}
}

Expand Down
8 changes: 0 additions & 8 deletions catalogs/catalog-lakehouse-paimon/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,6 @@ tasks.test {
exclude("**/integration/**")
} else {
dependsOn(tasks.jar)

doFirst {
environment("GRAVITINO_CI_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-hive:0.1.13")
environment("GRAVITINO_CI_KERBEROS_HIVE_DOCKER_IMAGE", "datastrato/gravitino-ci-kerberos-hive:0.1.3")
}

val init = project.extra.get("initIntegrationTest") as (Test) -> Unit
init(this)
}
}

Expand Down
2 changes: 1 addition & 1 deletion clients/client-python/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ tasks {
"GRAVITINO_HOME" to project.rootDir.path + "/distribution/package",
"START_EXTERNAL_GRAVITINO" to "true",
"DOCKER_TEST" to dockerTest.toString(),
"GRAVITINO_CI_HIVE_DOCKER_IMAGE" to "datastrato/gravitino-ci-hive:0.1.13",
"GRAVITINO_CI_HIVE_DOCKER_IMAGE" to "apache/gravitino-ci:hive-0.1.13",
// Set the PYTHONPATH to the client-python directory, make sure the tests can import the
// modules from the client-python directory.
"PYTHONPATH" to "${project.rootDir.path}/clients/client-python"
Expand Down
2 changes: 1 addition & 1 deletion dev/docker/trino/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ RUN mkdir /tmp/gravitino
COPY --chown=trino:trino packages/gravitino-trino-connector /tmp/gravitino

ARG IMAGE_NAME
RUN if [ "$IMAGE_NAME" = "datastrato/trino" ] ; then \
RUN if [ "$IMAGE_NAME" = "apache/gravitino-*:trino-*" ] ; then \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diqiu50
Please help to verify this part.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I this this is better:

apache/gravitino-trino-*:*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this PR, the name for Trino Docker image will be:

apache/gravitino-ci:trino-xxxx
apache/gravitino-playground:trino-xxxx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diqiu50
We will use the tag name to indicate whether it's a Trino image, so please help verify its accuracy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's ok.

mv /tmp/gravitino /usr/lib/trino/plugin/; \
else echo "Copying files for other images"; \
fi
Expand Down
Binary file added docs/assets/publish-docker-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/assets/publish-docker-image.png
Binary file not shown.
Loading
Loading