Skip to content

Commit

Permalink
Update DSE image builds based on docker-images (#208)
Browse files Browse the repository at this point in the history
* Add initial DSE docker image changes

* Remove defunct files

* Update DSE image build to use compiled Agent

* Update docs for DSE changes
  • Loading branch information
emerkle826 authored Sep 23, 2022
1 parent d03f6b7 commit 5b3a5d8
Show file tree
Hide file tree
Showing 18 changed files with 1,138 additions and 481 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ jobs:
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push'}}
needs: build-dse
runs-on: ubuntu-latest
strategy:
matrix:
jdk-version: [jdk8, jdk11]
steps:
- name: Check out source code
uses: actions/checkout@v2
Expand Down Expand Up @@ -161,7 +164,7 @@ jobs:
uses: docker/metadata-action@v3
with:
images: datastax/dse-mgmtapi-6_8
tags: type=sha,prefix=dse68-
tags: type=sha,prefix=dse68-${{ matrix.jdk-version }}-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
Expand All @@ -173,8 +176,9 @@ jobs:
id: docker_build
uses: docker/build-push-action@v2
with:
file: Dockerfile-dse-68
file: dse-68/Dockerfile.${{ matrix.jdk-version }}
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64
target: dse68
52 changes: 38 additions & 14 deletions .github/workflows/docker-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ jobs:
strategy:
fail-fast: false
matrix:
cassandra-version: [6.8.25]
dse-version: [6.8.25, 6.8.26]
image-base: [jdk8, jdk11]
include:
- cassandra-version: 6.8.25
- dse-version: 6.8.26
latest: true
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -46,27 +47,50 @@ jobs:
version: latest
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
- if: ${{ matrix.latest }}
name: Publish ${{ matrix.cassandra-version }} to Registry
- if: ${{ matrix.latest }} && ${{ matrix.image-base }} == 'jdk8'
name: Publish ${{ matrix.dse-version }} (${{ matrix.image-base }}) to Registry
run: |
RELEASE_VERSION="${GITHUB_REF##*/}"
docker buildx build --push \
--build-arg CASSANDRA_VERSION=${{ matrix.cassandra-version }} \
--build-arg DSE_VERSION=${{ matrix.dse-version }} \
--tag datastax/dse-mgmtapi-6_8:6.8 \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.cassandra-version }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.cassandra-version }}-$RELEASE_VERSION \
--file Dockerfile-dse-68 \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.dse-version }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.dse-version }}-$RELEASE_VERSION \
--file dse-68/Dockerfile.${{ matrix.image-base }} }} \
--target dse68 \
--platform linux/amd64 .
- if: ${{ !matrix.latest }}
name: Publish ${{ matrix.cassandra-version }} to Registry
- if: ${{ matrix.latest }} && ${{ matrix.image-base }} != 'jdk8'
name: Publish ${{ matrix.dse-version }} (${{ matrix.image-base }}) to Registry
run: |
RELEASE_VERSION="${GITHUB_REF##*/}"
docker buildx build --push \
--build-arg CASSANDRA_VERSION=${{ matrix.cassandra-version }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.cassandra-version }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.cassandra-version }}-$RELEASE_VERSION \
--file Dockerfile-dse-68 \
--build-arg DSE_VERSION=${{ matrix.dse-version }} \
--tag datastax/dse-mgmtapi-6_8:6.8-${{ matrix.image-base }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.dse-version }}-${{ matrix.image-base }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.dse-version }}-${{ matrix.image-base }}-$RELEASE_VERSION \
--file dse-68/Dockerfile.${{ matrix.image-base }} }} \
--target dse68 \
--platform linux/amd64 .
- if: ${{ !matrix.latest }} && ${{ matrix.image-base }} == 'jdk8'
name: Publish ${{ matrix.dse-version }} (${{ matrix.image-base }}) to Registry
run: |
RELEASE_VERSION="${GITHUB_REF##*/}"
docker buildx build --push \
--build-arg DSE_VERSION=${{ matrix.dse-version }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.dse-version }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.dse-version }}-$RELEASE_VERSION \
--file dse-68/Dockerfile.${{ matrix.image-base }} }} \
--target dse68 \
--platform linux/amd64 .
- if: ${{ !matrix.latest }} && ${{ matrix.image-base }} != 'jdk8'
name: Publish ${{ matrix.cassandra-version }} (${{ matrix.image-base }}) to Registry
run: |
RELEASE_VERSION="${GITHUB_REF##*/}"
docker buildx build --push \
--build-arg DSE_VERSION=${{ matrix.dse-version }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.dse-version }}-${{ matrix.image-base }} \
--tag datastax/dse-mgmtapi-6_8:${{ matrix.dse-version }}-${{ matrix.image-base }}-$RELEASE_VERSION \
--file dse-68/Dockerfile.${{ matrix.image-base }} }} \
--target dse68 \
--platform linux/amd64 .
Expand Down
68 changes: 0 additions & 68 deletions Dockerfile-astra-4_0

This file was deleted.

20 changes: 0 additions & 20 deletions Dockerfile-build

This file was deleted.

21 changes: 0 additions & 21 deletions Dockerfile-build-dse

This file was deleted.

78 changes: 0 additions & 78 deletions Dockerfile-dse-68

This file was deleted.

28 changes: 8 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@ The following versions of Cassandra and DSE are published to Docker and supporte
k8ssandra/cass-management-api:4.0.4
k8ssandra/cass-management-api:4.0.5
k8ssandra/cass-management-api:4.0.6
datastax/dse-mgmtapi-6_8:6.8.25
datastax/dse-mgmtapi-6_8:6.8.25 (jdk8 and jdk11 based images)
datastax/dse-mgmtapi-6_8:6.8.26 (jdk8 and jdk11 based images)

### Containers

First, you will need to have the [Docker buildx plugin](https://docs.docker.com/buildx/working-with-buildx/) installed.
First, you will need to have the [Docker buildx plugin](https://docs.docker.com/build/buildx/install/) installed.

To build an image based on the desired Cassandra or DSE version see the examples below:
To build an image based on the desired Cassandra version see the examples below:

#Create a docker image with management api and C* 3.11 (version 3.11.7 and newer are supported, replace `3.11.11` with the version you want below)
docker buildx build --load --build-arg CASSANDRA_VERSION=3.11.11 --tag mgmtapi-3_11 --file Dockerfile-oss --target oss311 --platform linux/amd64 .

#Create a docker image with management api and C* 4.0 (version 4.0.0 and newer are supported)
docker buildx build --load --build-arg CASSANDRA_VERSION=4.0.1 --tag mgmtapi-4_0 --file Dockerfile-4_0 --target oss40 --platform linux/amd64 .

#Create a docker image with management api and DSE 6.8 (version 6.8.25 and newer are supported, see [Usage with DSE](#usage-with-dse) below)
docker buildx build --load --build-arg CASSANDRA_VERSION=6.8.25 --tag mgmtapi-dse --file Dockerfile-dse-68 --target dse68 --platform linux/amd64 .
To build an image based on DSE, see the [DSE README](management-api-agent-dse-6.8/README.md).

### Standalone

Expand Down Expand Up @@ -124,9 +124,7 @@ To build an image based on the desired Cassandra or DSE version see the examples
- [Management API for Apache Cassandra 3.11.10](https://hub.docker.com/repository/docker/datastax/cassandra-mgmtapi-3_11_10)
- [Management API for Apache Cassandra 4.0-beta4](https://hub.docker.com/repository/docker/datastax/cassandra-mgmtapi-4_0_0).

For DSE Docker images, the location is:

- [Management API for DSE 6.8](https://hub.docker.com/repository/docker/datastax/dse-mgmtapi-6_8)
For DSE Docker images, see the [DSE README](management-api-agent-dse-6.8/README.md).

For running standalone the jars can be downloaded from the github release:
[Management API Releases Zip](https://github.com/k8ssandra/management-api-for-apache-cassandra/releases)
Expand All @@ -147,19 +145,9 @@ To build an image based on the desired Cassandra or DSE version see the examples

## Usage with DSE

A DSE jar must be locally available before running the Management API with DSE. Details are described in the [DSE README](management-api-shim-dse-6.8/README.md).
Once you have DSE jars published locally, follow these steps:
```
# The builder image needs to have Maven settings.xml (that provides access to Artifactory):
cp $HOME/.m2/settings.xml $PWD
docker buildx build --load --build-arg CASSANDRA_VERSION=6.8.25 --tag mgmtapi-dse --file Dockerfile-dse-68 --target dse68 --platform linux/amd64 .
docker run -p 8080:8080 -it --rm mgmtapi-dse
```
Please see the [DSE README](management-api-agent-dse-6.8/README.md) for details.

### Using the Service with a locally installed C* or DSE instance
## Using the Service with a locally installed C* or DSE instance


To start the service with a locally installed C* or DSE instance, you would run the below commands. The Management API will figure out
Expand Down
22 changes: 0 additions & 22 deletions dse-68/Dockerfile

This file was deleted.

Loading

0 comments on commit 5b3a5d8

Please sign in to comment.