Skip to content

Commit 3590339

Browse files
authored
Fix Helm chart requirements lock and version linting (#925)
* Add validation count for version linting * Add improved version linting * Update Helm documentation * Add lint validation for helm chart versions * Fix lint versions step name * Fix typo with FEAST_RELEASE_VERSION * Always update tags
1 parent 1f572e8 commit 3590339

10 files changed

Lines changed: 67 additions & 29 deletions

File tree

.github/workflows/complete.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
runs-on: [ubuntu-latest]
7070
steps:
7171
- uses: actions/checkout@v2
72-
- name: install dependencies
72+
- name: Lint versions throughout repo
7373
run: make lint-versions
7474

7575
unit-test-java:

infra/charts/feast/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ feast-batch-serving:
281281
staging_location: gs://<bucket_name>/feast-staging-location
282282
initial_retry_delay_seconds: 3
283283
total_timeout_seconds: 21600
284-
write_triggering_frequency_seconds: 600
285284
subscriptions:
286285
- name: "*"
287286
project: "*"

infra/charts/feast/charts/feast-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Current chart version is `0.7-SNAPSHOT`
2323
| gcpServiceAccount.existingSecret.name | string | `"feast-gcp-service-account"` | Name of the existing secret containing the service account |
2424
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
2525
| image.repository | string | `"gcr.io/kf-feast/feast-core"` | Docker image repository |
26-
| image.tag | string | `"latest"` | Image tag |
26+
| image.tag | string | `"0.6.2"` | Image tag |
2727
| ingress.grpc.annotations | object | `{}` | Extra annotations for the ingress |
2828
| ingress.grpc.auth.enabled | bool | `false` | Flag to enable auth |
2929
| ingress.grpc.class | string | `"nginx"` | Which ingress controller to use |

infra/charts/feast/charts/feast-core/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ image:
55
# image.repository -- Docker image repository
66
repository: gcr.io/kf-feast/feast-core
77
# image.tag -- Image tag
8-
tag: latest
8+
tag: 0.6.2
99
# image.pullPolicy -- Image pull policy
1010
pullPolicy: IfNotPresent
1111

infra/charts/feast/charts/feast-jupyter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ Current chart version is `0.7-SNAPSHOT`
1717
| gcpServiceAccount.existingSecret.name | string | `"feast-gcp-service-account"` | Name of the existing secret containing the service account |
1818
| image.pullPolicy | string | `"Always"` | Image pull policy |
1919
| image.repository | string | `"gcr.io/kf-feast/feast-jupyter"` | Docker image repository |
20-
| image.tag | string | `"latest"` | Image tag |
20+
| image.tag | string | `"0.6.2"` | Image tag |
2121
| replicaCount | int | `1` | Number of pods that will be created |

infra/charts/feast/charts/feast-jupyter/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ image:
55
# image.repository -- Docker image repository
66
repository: gcr.io/kf-feast/feast-jupyter
77
# image.tag -- Image tag
8-
tag: latest
8+
tag: 0.6.2
99
# image.pullPolicy -- Image pull policy
1010
pullPolicy: Always
1111

infra/charts/feast/charts/feast-serving/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Current chart version is `0.7-SNAPSHOT`
2323
| gcpServiceAccount.existingSecret.name | string | `"feast-gcp-service-account"` | Name of the existing secret containing the service account |
2424
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
2525
| image.repository | string | `"gcr.io/kf-feast/feast-serving"` | Docker image repository |
26-
| image.tag | string | `"latest"` | Image tag |
26+
| image.tag | string | `"0.6.2"` | Image tag |
2727
| ingress.grpc.annotations | object | `{}` | Extra annotations for the ingress |
2828
| ingress.grpc.auth.enabled | bool | `false` | Flag to enable auth |
2929
| ingress.grpc.class | string | `"nginx"` | Which ingress controller to use |

infra/charts/feast/charts/feast-serving/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ image:
55
# image.repository -- Docker image repository
66
repository: gcr.io/kf-feast/feast-serving
77
# image.tag -- Image tag
8-
tag: latest
8+
tag: 0.6.2
99
# image.pullPolicy -- Image pull policy
1010
pullPolicy: IfNotPresent
1111

infra/charts/feast/requirements.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
dependencies:
22
- name: feast-core
33
repository: ""
4-
version: 0.5.1
4+
version: 0.6.2
55
- name: feast-serving
66
repository: ""
7-
version: 0.5.1
7+
version: 0.6.2
88
- name: feast-serving
99
repository: ""
10-
version: 0.5.1
10+
version: 0.6.2
1111
- name: feast-jupyter
1212
repository: ""
13-
version: 0.5.1
13+
version: 0.6.2
1414
- name: postgresql
1515
repository: https://kubernetes-charts.storage.googleapis.com/
1616
version: 8.6.1
Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,77 @@
11
#!/usr/bin/env bash
22

3-
# This script will scan through a list of files to validate that all versions are consistent with the master version
3+
# This script will scan through a list of files to validate that all versions are consistent with
4+
# - Master version (could be snapshot)
5+
# - Highest stable commit (latest tag)
46
set -e
57

6-
# List of files to validate
7-
declare -a files_to_validate=(
8-
"infra/charts/feast/Chart.yaml"
9-
"infra/charts/feast/charts/feast-core/Chart.yaml"
10-
"infra/charts/feast/charts/feast-serving/Chart.yaml"
11-
"infra/charts/feast/charts/feast-jupyter/Chart.yaml"
12-
"infra/charts/feast/requirements.yaml" # We are only testing for the version once
13-
)
14-
158
# Determine the current Feast version from Maven (pom.xml)
169
export FEAST_MASTER_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
1710
[[ -z "$FEAST_MASTER_VERSION" ]] && {
1811
echo "$FEAST_MASTER_VERSION is missing, please check pom.xml and maven"
1912
exit 1
2013
}
2114

15+
# Determine the highest released version from Git history
16+
git fetch --prune --unshallow --tags || true
17+
FEAST_RELEASE_VERSION_WITH_V=$(git tag -l --sort -version:refname | head -n 1)
18+
echo $FEAST_RELEASE_VERSION_WITH_V
19+
20+
export FEAST_RELEASE_VERSION=${FEAST_RELEASE_VERSION_WITH_V#"v"}
21+
echo $FEAST_RELEASE_VERSION
22+
23+
[[ -z "$FEAST_RELEASE_VERSION" ]] && {
24+
echo "FEAST_RELEASE_VERSION is missing"
25+
exit 1
26+
}
27+
28+
# List of files to validate with master version (from pom.xml)
29+
# Structure is a comma separated list of structure
30+
# <File to validate>, <Amount of occurrences of specific version to look for>, <version to look for>
31+
#
32+
33+
declare -a files_to_validate_version=(
34+
"infra/charts/feast/Chart.yaml,1,${FEAST_MASTER_VERSION}"
35+
"infra/charts/feast/charts/feast-core/Chart.yaml,1,${FEAST_MASTER_VERSION}"
36+
"infra/charts/feast/charts/feast-core/values.yaml,1,${FEAST_RELEASE_VERSION}"
37+
"infra/charts/feast/charts/feast-core/README.md,1,${FEAST_RELEASE_VERSION}"
38+
"infra/charts/feast/charts/feast-serving/Chart.yaml,1,${FEAST_MASTER_VERSION}"
39+
"infra/charts/feast/charts/feast-jupyter/values.yaml,1,${FEAST_RELEASE_VERSION}"
40+
"infra/charts/feast/charts/feast-jupyter/README.md,1,${FEAST_RELEASE_VERSION}"
41+
"infra/charts/feast/charts/feast-jupyter/Chart.yaml,1,${FEAST_MASTER_VERSION}"
42+
"infra/charts/feast/charts/feast-serving/values.yaml,1,${FEAST_RELEASE_VERSION}"
43+
"infra/charts/feast/charts/feast-serving/README.md,1,${FEAST_RELEASE_VERSION}"
44+
"infra/charts/feast/requirements.yaml,4,${FEAST_MASTER_VERSION}"
45+
"infra/charts/feast/requirements.lock,4,${FEAST_RELEASE_VERSION}"
46+
"infra/docker-compose/.env.sample,1,${FEAST_RELEASE_VERSION}"
47+
)
48+
2249
echo
23-
echo "Testing list of files to ensure they have the following version $FEAST_MASTER_VERSION"
50+
echo "Testing list of files to ensure they have the correct version"
2451
echo
2552

26-
for i in "${files_to_validate[@]}"; do
53+
for i in "${files_to_validate_version[@]}"; do
54+
IFS=',' read -r FILE_PATH EXPECTED_OCCURRENCES VERSION <<<"${i}"
2755
echo
2856
echo
29-
echo "Testing whether versions are correctly set within file: $i"
57+
echo "Testing whether versions are correctly set within file: $FILE_PATH"
3058
echo
3159
echo "File contents:"
3260
echo "========================================================="
33-
cat "$i"
61+
cat "$FILE_PATH"
62+
echo
3463
echo "========================================================="
35-
grep -q "$FEAST_MASTER_VERSION" "$i"
36-
echo "SUCCESS: Version found"
64+
ACTUAL_OCCURRENCES=$(grep -c "$VERSION" "$FILE_PATH" || true)
65+
66+
if [ "${ACTUAL_OCCURRENCES}" -eq "${EXPECTED_OCCURRENCES}" ]; then
67+
echo "SUCCESS"
68+
echo
69+
echo "Expecting $EXPECTED_OCCURRENCES occurrences of $VERSION in $FILE_PATH, and found $ACTUAL_OCCURRENCES"
70+
else
71+
echo "FAILURE"
72+
echo
73+
echo "Expecting $EXPECTED_OCCURRENCES occurrences of $VERSION in $FILE_PATH, but found $ACTUAL_OCCURRENCES"
74+
exit 1
75+
fi
3776
echo "========================================================="
38-
done
77+
done

0 commit comments

Comments
 (0)