Skip to content

Commit

Permalink
Upgrade docker image to ubuntu 22.04 (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
adejanovski authored Sep 19, 2023
1 parent e653bc6 commit 5841926
Show file tree
Hide file tree
Showing 17 changed files with 199 additions and 380 deletions.
3 changes: 2 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.15.0-dev
current_version = 0.16.0-dev
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
Expand All @@ -17,3 +17,4 @@ values =
[bumpversion:file:VERSION]

[bumpversion:file:setup.py]

104 changes: 102 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,109 @@ jobs:
- uses: codecov/codecov-action@v1
name: Report code coverage

k8ssandra-e2e-tests:
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
e2e_test:
- CreateSingleMedusaJob
fail-fast: false
name: k8ssandra-${{ matrix.e2e_test }}
env:
CGO_ENABLED: 0
KUBECONFIG_FILE: "./build/kind-kubeconfig"
CONTROL_PLANE: kind-k8ssandra-0
DATA_PLANES: kind-k8ssandra-0
steps:
- name: Raise open files limit
run: |
echo fs.file-max=1000000 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
echo fs.inotify.max_user_instances=1280 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
echo fs.inotify.max_user_watches=655360 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
ulimit -a
- name: Free diskspace by removing unused packages
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.K8SSANDRA_DOCKER_HUB_USERNAME }}
password: ${{ secrets.K8SSANDRA_DOCKER_HUB_PASSWORD }}
- uses: actions/checkout@v3
with:
path: cassandra-medusa
- uses: actions/checkout@v3
with:
repository: k8ssandra/k8ssandra-operator
# Modify this line to use a different branch when making changes to the operator affecting Medusa
# Change to main once the operator changes are merged
ref: add-medusa-non-regression-test
path: k8ssandra-operator
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
cache: true
cache-dependency-path: "**/*.sum"
- name: Install Kind
working-directory: k8ssandra-operator
run: go get sigs.k8s.io/kind
- name: Install kustomize
uses: imranismail/setup-kustomize@v2
with:
kustomize-version: 4.x
- name: Build Medusa
working-directory: cassandra-medusa
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
python setup.py build
- name: Build Medusa image
id: docker_build
uses: docker/build-push-action@v4
with:
file: cassandra-medusa/k8s/Dockerfile
context: ./cassandra-medusa
tags: k8ssandra/medusa:${{ env.short_sha }}-tmp
platforms: linux/amd64
push: true
- name: Setup kind cluster
working-directory: k8ssandra-operator
run: |
make single-create
- name: Run e2e test ( ${{ matrix.e2e_test }} )
working-directory: k8ssandra-operator
run: |
e2e_test="TestOperator/${{ matrix.e2e_test }}"
args="-kubeconfigFile '${{ env.KUBECONFIG_FILE }}'"
args="$args -controlPlane '${{ env.CONTROL_PLANE }}'"
args="$args -dataPlanes '${{ env.DATA_PLANES }}'"
args="$args -medusaImageTag ${{ env.short_sha }}-tmp"
make E2E_TEST="$e2e_test" TEST_ARGS="$args" e2e-test
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
- name: Get artefact upload directory
working-directory: k8ssandra-operator
if: ${{ failure() }}
run: |
uploaddir_name=$(echo ${{ matrix.e2e_test }}| sed 's/\//__/g')
echo 'setting uploaddir_name to' $uploaddir_name
echo "uploaddir_name=$uploaddir_name" >> $GITHUB_ENV
- name: Archive k8s logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: k8s-logs-${{ env.uploaddir_name }}
path: ./k8ssandra-operator/build/test

publish-docker-master:
needs: [debian-build, build, integration-tests]
needs: [debian-build, build, integration-tests, k8ssandra-e2e-tests]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -305,7 +405,7 @@ jobs:

publish-debian:
# We can only release if the build above succeeded first
needs: [debian-build, build, integration-tests]
needs: [debian-build, build, integration-tests, k8ssandra-e2e-tests]
if: github.event_name == 'release' && github.event.action == 'published'
strategy:
matrix:
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
## Change Log


### 0.15.0 (2023/07/07 12:03 +00:00)
- Ignore Statistics.db files as they can be rewritten at runtime and break verify (#587) (@VenkataNaladala94)
- Read the restore mapping from an env variable in k8s restore mode (#592) (@adejanovski)
- Upgrade cassandra-driver version (#582) (@azarnovdaniil)
- Switch GHA runners to Ubuntu 20.04 (#578) (@adejanovski)
- Correct clean_path execution in restore_node_sstableloader function. (#573) (@cmvelo)
- Concurrent calls of set_upload_bandwidth cause duplication in ".aws/config" (#571) (@mohammad-aburadeh)
- enable sourcing environment file within wrapper (#536) (@rtib)
- upload empty files with az cli command (#535) (@WentingWu666666)
- improve ipv6 compatibility (#562) (@tom-code)
- [k8s] supporting k8s-style secrets stored in a folder (#552) (@ufoot)

### 0.14.0 (2022/12/05 05:51 +00:00)
- Support for specifying KMS key for encrypting backups server-side on S3 (@justinmir)
- Rack aware cluster restore (@anclrii)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.15.0-dev
0.16.0-dev
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
cassandra-medusa (0.15.0) stable; urgency=medium

* Release 0.15.0 of Medusa - Backups for Apache Cassandra.

-- The Last Pickle <oss@thelastpickle.com> Fri, 07 Jul 2023 12:09:38 +0000

cassandra-medusa (0.14.0) stable; urgency=medium

* Release 0.14.0 of Medusa - Backups for Apache Cassandra.
Expand Down
16 changes: 2 additions & 14 deletions k8s/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
FROM ubuntu:18.04 as base
FROM ubuntu:22.04 as base

RUN mkdir /install
WORKDIR /install

RUN apt-get update && \
apt-get install -y software-properties-common curl gnupg

RUN add-apt-repository ppa:kalon33/gamesgiroll -y

RUN apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y \
debhelper \
dh-python \
python3-all \
python3-all-dev \
python3-dev \
python-dev \
python-pip \
python3-pip \
python3-setuptools \
python3-venv \
build-essential \
devscripts \
dh-virtualenv \
equivs \
wget \
apt-transport-https \
Expand All @@ -41,7 +35,7 @@ RUN python3 -m pip install -U pip && pip3 install --ignore-installed --user \
RUN pip3 install --ignore-installed --user /build

# Could be python:slim, but we have a .sh entrypoint
FROM ubuntu:18.04
FROM ubuntu:22.04

## add user
RUN groupadd -r cassandra --gid=999 && useradd -r -g cassandra --uid=999 --create-home cassandra
Expand All @@ -59,12 +53,6 @@ RUN GRPC_HEALTH_PROBE_VERSION=v0.3.2 && \
USER cassandra
WORKDIR /home/cassandra

# GCP sdk
COPY --chown=cassandra:cassandra k8s/clean-cloud-sdk.sh /home/cassandra/clean-cloud-sdk.sh
RUN wget -q https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz \
&& tar -zxvf google-cloud-sdk.tar.gz \
&& google-cloud-sdk/install.sh --quiet \
&& chmod +x clean-cloud-sdk.sh && ./clean-cloud-sdk.sh
ENV DEBUG_VERSION 1
ENV DEBUG_SLEEP 0
ENV PATH=/home/cassandra/.local/bin:/home/cassandra/google-cloud-sdk/bin:$PATH
Expand Down
75 changes: 0 additions & 75 deletions k8s/Dockerfile-azure

This file was deleted.

83 changes: 0 additions & 83 deletions k8s/Dockerfile-gcs

This file was deleted.

Loading

0 comments on commit 5841926

Please sign in to comment.