Skip to content

Commit

Permalink
Nessie CLI: publish Docker images (#8935)
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra authored Jun 28, 2024
1 parent a85ed38 commit d70db47
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .github/docker-sync/regsync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ sync:
- source: ghcr.io/projectnessie/nessie-server-admin
target: quay.io/projectnessie/nessie-server-admin
type: repository
# CLI
- source: ghcr.io/projectnessie/nessie-cli-unstable
target: quay.io/projectnessie/nessie-cli-unstable
type: repository
- source: ghcr.io/projectnessie/nessie-cli
target: quay.io/projectnessie/nessie-cli
type: repository
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ jobs:
echo "DOCKER_IMAGE=${DOCKER_REGISTRY}:5000/nessie-testing" >> ${GITHUB_ENV}
echo "DOCKER_GC_IMAGE=${DOCKER_REGISTRY}:5000/nessie-gc-testing" >> ${GITHUB_ENV}
echo "DOCKER_SERVER_ADMIN_IMAGE=${DOCKER_REGISTRY}:5000/nessie-server-admin-testing" >> ${GITHUB_ENV}
echo "DOCKER_CLI_IMAGE=${DOCKER_REGISTRY}:5000/nessie-cli-testing" >> ${GITHUB_ENV}
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
Expand All @@ -773,6 +774,12 @@ jobs:
-d "Dockerfile-admintool" \
${DOCKER_SERVER_ADMIN_IMAGE}
tools/dockerbuild/build-push-images.sh \
-g ":nessie-cli" \
-p "cli/cli" \
-d "Dockerfile-cli" \
${DOCKER_CLI_IMAGE}
- name: Cleanup buildx
run: |
docker buildx use default
Expand All @@ -792,6 +799,10 @@ jobs:
docker pull ${DOCKER_SERVER_ADMIN_IMAGE}:latest-java
docker pull ${DOCKER_SERVER_ADMIN_IMAGE}:${DOCKER_VERSION}
docker pull ${DOCKER_SERVER_ADMIN_IMAGE}:${DOCKER_VERSION}-java
docker pull ${DOCKER_CLI_IMAGE}:latest
docker pull ${DOCKER_CLI_IMAGE}:latest-java
docker pull ${DOCKER_CLI_IMAGE}:${DOCKER_VERSION}
docker pull ${DOCKER_CLI_IMAGE}:${DOCKER_VERSION}-java
cat <<! >> $GITHUB_STEP_SUMMARY
## Docker images
Expand Down Expand Up @@ -858,6 +869,23 @@ jobs:
exit 1
fi
- name: Check if CLI Docker Java image works
run: |
if docker run --rm --name nessie-cli ${DOCKER_CLI_IMAGE}:latest-java --help | grep -q "Usage: nessie-cli.jar"; then
echo "## CLI Java Docker image smoke test: PASSED" >> $GITHUB_STEP_SUMMARY
echo "CLI Java Docker image smoke test: PASSED"
else
echo "CLI Java Docker image smoke test: FAILED" > /dev/stderr
cat <<! >> $GITHUB_STEP_SUMMARY
## CLI Java Docker image FAILED
\`\`\`
$(docker logs nessie-cli)
\`\`\`
!
exit 1
fi
- name: Run chart-testing (list-changed)
run: |
ct list-changed --target-branch ${{ github.event.repository.default_branch }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ jobs:
-d "Dockerfile-admintool" \
ghcr.io/projectnessie/nessie-server-admin
- name: Publish Nessie CLI
run: |
tools/dockerbuild/build-push-images.sh \
-g ":nessie-cli" \
-p "cli/cli" \
-d "Dockerfile-cli" \
ghcr.io/projectnessie/nessie-cli
publish-helm:
name: Publish Helm Chart
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/snapshot-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,8 @@ jobs:
-p "tools/server-admin" \
-d "Dockerfile-admintool" \
ghcr.io/projectnessie/nessie-server-admin-unstable
tools/dockerbuild/build-push-images.sh \
-g ":nessie-cli" \
-p "cli/cli" \
-d "Dockerfile-cli" \
ghcr.io/projectnessie/nessie-cli-unstable
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ as necessary. Empty sections will not end in the release notes.

### New Features

- Nessie CLI now has its own Docker images. Running Nessie CLI is now as simple as: `docker run -it
ghcr.io/projectnessie/nessie-cli`. Read more about it
[here](https://projectnessie.org/nessie-latest/cli/).

### Changes

### Deprecations
Expand Down
45 changes: 45 additions & 0 deletions docker/cli/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Copyright (C) 2024 Dremio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# In order to have an interactive shell for Nessie CLI, execute the following command:
# docker-compose run nessie-cli

services:

nessie:
image: ghcr.io/projectnessie/nessie:0.91.2
ports:
# API port
- "19120:19120"
# Management port (metrics and health checks)
- "9000:9000"
environment:
- nessie.version.store.type=IN_MEMORY # Ephemeral storage, data is lost during reset.
healthcheck:
test: "exec 3<>/dev/tcp/localhost/9000 && echo -e 'GET /q/health HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && cat <&3 | grep -q '200 OK'"
interval: 5s
timeout: 2s
retries: 15

nessie-cli:
image: ghcr.io/projectnessie/nessie-cli:0.91.2
stdin_open: true # docker run -i
tty: true # docker run -t
depends_on:
nessie:
condition: service_healthy
command:
- --uri=http://nessie:19120/api/v2
17 changes: 17 additions & 0 deletions site/docs/downloads/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@ java -jar nessie-quarkus-{{ versions.nessie }}-runner.jar

[Nessie CLI](/nessie-latest/cli/) is both a command-line interface but primarily a REPL.

### Docker image

Docker images are multiplatform images for amd64, arm64, ppc64le, s390x.

=== "GitHub Container Registry"
[GitHub Container Registry](https://github.com/projectnessie/nessie/pkgs/container/nessie-cli)
```bash
docker pull ghcr.io/projectnessie/nessie-cli:{{ versions.nessie }}
docker run -it ghcr.io/projectnessie/nessie-cli:{{ versions.nessie }}
```
=== "Quay.io"
[quay.io](https://quay.io/repository/projectnessie/nessie-cli?tab=tags)
```bash
docker pull quay.io/projectnessie/nessie-cli:{{ versions.nessie }}
docker run -it quay.io/projectnessie/nessie-cli:{{ versions.nessie }}
```

### Standalone uber jar

Requires Java 11 or newer.
Expand Down
26 changes: 11 additions & 15 deletions site/in-dev/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ title: "Nessie CLI"
# Nessie CLI

The Nessie CLI is an easy way to get started with Nessie. It supports multiple branch
and tag management capabilities. This is installed as a standalone uber jar from the
[Nessie download page](../downloads/index.md) or the
[releases page on GitHub](https://github.com/projectnessie/nessie/releases/).
and tag management capabilities.

Nessie CLI is designed to be usable as an interactive REPL supporting auto-completion,
highlighting where appropriate and has built-in help. Long outputs, like a commit log,
Expand All @@ -17,23 +15,21 @@ are automatically paged like the Unix `less` command.

![Nessie CLI](../img/cli-intro.png)

## Usage
## Installation

Nessie CLI requires Java 11.
Nessie CLI is available as a standalone uber jar, or as a Docker image. See download options in
the [Nessie download page](../downloads/index.md) or in the [releases page on
GitHub](https://github.com/projectnessie/nessie/releases/).

```bash
java -jar nessie-cli-<version>.jar
```
## Usage

!!! tip
Use `CONNECT TO http://127.0.0.1:19120/iceberg` to connect to a locally running Nessie
instance with Iceberg REST. Use `CONNECT TO http://127.0.0.1:19120/api/v2` for Nessie's
native REST API.
Use `CONNECT TO http://127.0.0.1:19120/iceberg` to connect to a locally running Nessie instance with
Iceberg REST. Use `CONNECT TO http://127.0.0.1:19120/api/v2` for Nessie's native REST API.

Use `CONNECT TO https://app.dremio.cloud/repositories/<project-id>/api/v2` to
connect to your Dremio cloud instance using Nessie's native REST API.
Use `CONNECT TO https://app.dremio.cloud/repositories/<project-id>/api/v2` to connect to your Dremio
cloud instance using Nessie's native REST API.

See [`CONNECT` statement](#connect) below.
See [`CONNECT` statement](#connect) below.

### Command line options

Expand Down
17 changes: 17 additions & 0 deletions site/in-dev/index-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ java -jar nessie-quarkus-::NESSIE_VERSION::-runner.jar

[Nessie CLI](cli.md) is both a command-line interface but primarily a REPL.

### Docker image

Docker images are multiplatform images for amd64, arm64, ppc64le, s390x.

=== "GitHub Container Registry"
[GitHub Container Registry](https://github.com/projectnessie/nessie/pkgs/container/nessie-cli)
```bash
docker pull ghcr.io/projectnessie/nessie-cli:::NESSIE_VERSION::
docker run -it ghcr.io/projectnessie/nessie-cli:::NESSIE_VERSION::
```
=== "Quay.io"
[quay.io](https://quay.io/repository/projectnessie/nessie-cli?tab=tags)
```bash
docker pull quay.io/projectnessie/nessie-cli:::NESSIE_VERSION::
docker run -it quay.io/projectnessie/nessie-cli:::NESSIE_VERSION::
```

### Standalone uber jar

Requires Java 11 or newer.
Expand Down
21 changes: 21 additions & 0 deletions site/in-dev/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ Docker images are multiplatform images for amd64, arm64, ppc64le, s390x.
docker run -p 19120:19120 -p 9000:9000 quay.io/projectnessie/nessie-unstable
```

## Nessie CLI unstable/nightly

### Docker image

Docker images are multiplatform images for amd64, arm64, ppc64le, s390x.

**The image tags are updated twice per day during weekdays.**

=== "GitHub Container Registry"
[GitHub Container Registry](https://github.com/projectnessie/nessie/pkgs/container/nessie-cli-unstable)
```bash
docker pull ghcr.io/projectnessie/nessie-cli-unstable
docker run -it ghcr.io/projectnessie/nessie-cli-unstable
```
=== "Quay.io"
[quay.io](https://quay.io/repository/projectnessie/nessie-cli-unstable?tab=tags)
```bash
docker pull quay.io/projectnessie/nessie-cli-unstable
docker run -it quay.io/projectnessie/nessie-cli-unstable
```

## GC Tool unstable/nightly

[Nessie GC](/nessie-nightly/gc/) allows mark and sweep data files based on flexible
Expand Down
7 changes: 5 additions & 2 deletions tools/dockerbuild/build-push-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function usage() {
$0 --dockerfile Dockerfile-server --gradle-project :nessie-quarkus --project-dir servers/quarkus-server nessie-unstable
$0 --dockerfile Dockerfile-gctool --gradle-project :nessie-gc-tool --project-dir gc/gc-tool nessie-gc-unstable
$0 --dockerfile Dockerfile-admintool --gradle-project :nessie-server-admin-tool --project-dir tools/server-admin nessie-admin-unstable
$0 --dockerfile Dockerfile-cli --gradle-project :nessie-cli --project-dir cli/cli nessie-cli-unstable
!
}

Expand Down Expand Up @@ -127,8 +128,8 @@ cd "$BASE_DIR"
#

gh_group "Prepare Docker image name and tag base"
IMAGE_TAG="$(cat version.txt)"
IMAGE_TAG_BASE="${IMAGE_TAG%-SNAPSHOT}"
VERSION="$(cat version.txt)"
IMAGE_TAG_BASE="${VERSION%-SNAPSHOT}"
echo "Image name: ${IMAGE_NAME}"
echo "Tag base: ${IMAGE_TAG_BASE}"
gh_endgroup
Expand Down Expand Up @@ -163,6 +164,7 @@ if [[ ${LOCAL} == 1 ]] ; then
--file "${BASE_DIR}/tools/dockerbuild/docker/${DOCKERFILE}" \
--tag "${IMAGE_NAME}:latest" \
--tag "${IMAGE_NAME}:${IMAGE_TAG_BASE}" \
--build-arg VERSION="${VERSION}" \
"${BASE_DIR}/${PROJECT_DIR}"
gh_endgroup
else
Expand All @@ -176,6 +178,7 @@ else
--tag "${IMAGE_NAME}:latest-java" \
--tag "${IMAGE_NAME}:${IMAGE_TAG_BASE}" \
--tag "${IMAGE_NAME}:${IMAGE_TAG_BASE}-java" \
--build-arg VERSION="${VERSION}" \
"${BASE_DIR}/${PROJECT_DIR}" \
--push \
--provenance=false --sbom=false \
Expand Down
15 changes: 15 additions & 0 deletions tools/dockerbuild/docker/Dockerfile-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.20-2

LABEL org.opencontainers.image.source=https://github.com/projectnessie/nessie
LABEL org.opencontainers.image.description="Projectnessie CLI"
LABEL org.opencontainers.image.licenses=Apache-2.0

ARG VERSION

ENV LANGUAGE='en_US:en'

COPY --chown=185 build/libs/nessie-cli-$VERSION.jar /nessie-cli.jar

USER 185

ENTRYPOINT [ "java", "-jar", "/nessie-cli.jar" ]
3 changes: 3 additions & 0 deletions tools/releases/create-gh-release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ NUM_COMMITS=$(git log --format='format:%h' ${LAST_TAG}..HEAD^1 | wc -l | xargs)

git log --perl-regexp --author '^(?!.*renovate|.*nessie-release-workflow).*$' --format='format:* %s' ${LAST_TAG}..${GIT_TAG} | grep -v '^\* \[release\] .*$' > ./release-log

Q_CLI_URL="https://github.com/projectnessie/nessie/releases/download/nessie-${RELEASE_VERSION}/nessie-cli-${RELEASE_VERSION}.jar"
Q_GC_TOOL_URL="https://github.com/projectnessie/nessie/releases/download/nessie-${RELEASE_VERSION}/nessie-gc-${RELEASE_VERSION}.jar"
Q_UBER_URL="https://github.com/projectnessie/nessie/releases/download/nessie-${RELEASE_VERSION}/nessie-quarkus-${RELEASE_VERSION}-runner.jar"
Q_SERVER_ADMIN_URL="https://github.com/projectnessie/nessie/releases/download/nessie-${RELEASE_VERSION}/nessie-server-admin-tool-${RELEASE_VERSION}-runner.jar"
Expand All @@ -106,6 +107,8 @@ wget ${Q_UBER_URL}
java -jar nessie-quarkus-${RELEASE_VERSION}-runner.jar
\`\`\`
Nessie CLI is attached as [\`nessie-cli-${RELEASE_VERSION}.jar\`](${Q_CLI_URL}), which is a standalone uber-jar file that runs on Java 11 or newer. Nessie CLI is also available as a Docker image: \`docker run --rm -it ghcr.io/projectnessie/nessie-cli:${RELEASE_VERSION}\`.
Nessie GC tool is attached as [\`nessie-gc-${RELEASE_VERSION}.jar\`](${Q_GC_TOOL_URL}), which is a standalone uber-jar file that runs on Java 11 or newer. Shell completion can be generated from the tool, check its \`help\` command. Nessie GC tool is also available as a Docker image: \`docker run --rm ghcr.io/projectnessie/nessie-gc:${RELEASE_VERSION} --help\`.
Nessie Server Admin tool is attached as [\`nessie-server-admin-tool-${RELEASE_VERSION}-runner.jar\`](${Q_SERVER_ADMIN_URL}), which is a standalone uber-jar file that runs on Java 17 or newer. Shell completion can be generated from the tool, check its \`help\` command. Nessie Server Admin tool is also available as a Docker image: \`docker run --rm ghcr.io/projectnessie/nessie-server-admin:${RELEASE_VERSION} --help\`.
Expand Down

0 comments on commit d70db47

Please sign in to comment.