diff --git a/.dockerignore b/.dockerignore index 1f69b9c2f..7350d4111 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,7 +5,6 @@ .cache .dockerignore .env -.git .github .gitignore .idea diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eaa665c7b..eb5c66cf1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,6 @@ name: Build on: pull_request: branches: - - main - "release-[0-9].[0-9]+" paths-ignore: - "**.md" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..cf7694485 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +# Copyright 2021 IBM Corporation +# +# 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. +repos: + - repo: https://github.com/golangci/golangci-lint + rev: v1.43.0 + hooks: + - id: golangci-lint + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.4.1 + hooks: + - id: prettier diff --git a/Dockerfile b/Dockerfile index 1afe4c34c..b0d192811 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,7 @@ RUN --mount=type=cache,target=/root/.cache/microdnf:rw \ tar \ gzip \ maven \ + git \ && true # Install etcd -- used for CI tests @@ -74,6 +75,11 @@ ENV MAVEN_OPTS="-Dfile.encoding=UTF8" RUN --mount=type=cache,target=/root/.m2 \ mvn -B package -DskipTests=true --file pom.xml +# Assume that source code comes from a Git repository +RUN echo "$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)" > target/dockerhome/build-version && \ + echo "$(git rev-parse HEAD)" > target/dockerhome/release && \ + echo "$(git branch --show-current|sed 's/^release-//g')-$(git branch --show-current)_$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)" > target/dockerhome/version + ############################################################################### FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6 AS runtime @@ -97,6 +103,7 @@ RUN --mount=type=cache,target=/root/.cache/microdnf:rw \ && true COPY --from=build /build/target/dockerhome/ /opt/kserve/mmesh/ +COPY version /etc/modelmesh-version # Make this the current directory when starting the container WORKDIR /opt/kserve/mmesh @@ -123,18 +130,19 @@ RUN --mount=type=cache,target=/root/.cache/microdnf:rw \ # wait to create commit-specific LABEL until end of the build to not unnecessarily # invalidate the cached image layers -ARG imageVersion -ARG buildId -ARG commitSha +# ARG imageVersion +# ARG buildId +# ARG commitSha -RUN echo "${buildId}" > /opt/kserve/mmesh/build-version +# Generated at build stage +# RUN echo "${buildId}" > /opt/kserve/mmesh/build-version LABEL name="model-mesh" \ vendor="KServe" \ - version="${imageVersion}" \ +# version="${imageVersion}" \ summary="Core model-mesh sidecar image" \ description="Model-mesh is a distributed LRU cache for serving runtime models" \ - release="${commitSha}" \ +# release="${commitSha}" \ maintainer="nickhill@us.ibm.com" EXPOSE 8080 diff --git a/OWNERS b/OWNERS index 84f618b65..95f2cce31 100644 --- a/OWNERS +++ b/OWNERS @@ -1,13 +1,24 @@ approvers: - - njhill - - tjohnson31415 - - ckadner - - rafvasq + - anishasthana + - danielezonca + - davidesalerno + - heyselbi + - israel-hdez + - Jooho + - rpancham + - spolti + - vaibhavjainwiz + - VedantMahabaleshwarkar + - Xaenalt reviewers: - - njhill - - tjohnson31415 - - ckadner - - rafvasq -emeritus_approvers: - - animeshsingh # 2023-04-12 - - pvaneck # 2023-04-12 + - anishasthana + - danielezonca + - davidesalerno + - heyselbi + - israel-hdez + - Jooho + - rpancham + - spolti + - vaibhavjainwiz + - VedantMahabaleshwarkar + - Xaenalt diff --git a/pom.xml b/pom.xml index c2c50f956..c212f7403 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ - + yyyyMMdd-HHmm ${maven.build.timestamp} UTF-8 @@ -74,7 +74,7 @@ 0.9.0 - 1.74 + 1.78 5.10.1 3.7.2 @@ -274,7 +274,7 @@ - + diff --git a/version b/version new file mode 100644 index 000000000..793e52c31 --- /dev/null +++ b/version @@ -0,0 +1,4 @@ +# Version information +upstream kserve/modelmesh version: v0.11.0-rc0 +opendatahub version: latest +opendatahub modelmesh branch: main