Skip to content

Commit ddceace

Browse files
committed
add lock to read from nodeProviderIDs
add publishing script
1 parent c762dc5 commit ddceace

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

build/build-image/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ ADD rsyncd.password /
5555
RUN chmod a+r /rsyncd.password
5656
ADD rsyncd.sh /
5757
RUN chmod a+rx /rsyncd.sh
58+
RUN apt update && apt install -y gcc-x86-64-linux-gnu gcc-arm-linux-gnueabihf

publish_openai.sh

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env sh
2+
3+
set -euo pipefail
4+
5+
X=$1
6+
Y=$2
7+
Z=$3
8+
9+
if [ -z "$X" ] || [ -z "$Y" ] || [ -z "$Z" ]; then
10+
echo "Usage: $0 <X> <Y> <Z>"
11+
echo ""
12+
exit 1
13+
fi
14+
15+
TAG="v1.$X.$Y-openai$Z"
16+
ACTUAL_TAG=$(git describe --tags --exact-match)
17+
18+
# Tag should match git tag so the version injected into the binaries by k8s
19+
# build process matches the name of the uploaded binaries
20+
if [ "$TAG" != "$ACTUAL_TAG" ]; then
21+
echo "Tag mismatch: $TAG != $ACTUAL_TAG"
22+
echo "Ensure your commit is tagged with the version you are trying to upload"
23+
exit 1
24+
fi
25+
26+
TARGETS=(
27+
kube-apiserver
28+
kube-controller-manager
29+
kube-scheduler
30+
kube-proxy
31+
kubelet
32+
kubectl
33+
)
34+
35+
PLATFORMS=(
36+
linux/amd64
37+
linux/arm64
38+
)
39+
40+
# One some older k8s versions the build image is not very good and doesn't include
41+
# proper deps
42+
# You may need to edit "build/build-image/Dockerfile" to include:
43+
# RUN apt update && apt install -y gcc-x86-64-linux-gnu gcc-arm-linux-gnueabihf
44+
export KUBE_BUILD_PLATFORMS="${PLATFORMS[@]}"
45+
export KUBE_BUILD_CONFORMANCE=n
46+
47+
./build/run.sh make cross WHAT="${TARGETS[@]/#/cmd/}"
48+
49+
for PLATFORM in "${PLATFORMS[@]}"; do
50+
for TARGET in "${TARGETS[@]}"; do
51+
shasum -a 256 "_output/dockerized/bin/${PLATFORM}/${TARGET}"
52+
az storage blob upload \
53+
--account-name=oaiinfraartifacts \
54+
--container-name=artifacts \
55+
--name="kubernetes-release/release/${TAG}/bin/${PLATFORM}/${TARGET}" \
56+
--file="_output/dockerized/bin/${PLATFORM}/${TARGET}" \
57+
--overwrite \
58+
--auth-mode login
59+
done
60+
done
61+
62+
# Reprint SHAs for convenience
63+
for PLATFORM in "${PLATFORMS[@]}"; do
64+
for TARGET in "${TARGETS[@]}"; do
65+
shasum -a 256 "_output/dockerized/bin/${PLATFORM}/${TARGET}"
66+
done
67+
done

staging/src/k8s.io/legacy-cloud-providers/azure/azure_instances.go

+3
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ func (az *Cloud) CurrentNodeName(ctx context.Context, hostname string) (types.No
427427

428428
// mapNodeNameToVMName maps a k8s NodeName to an Azure VM Name using providerID.
429429
func (az *Cloud) mapNodeNameToVMName(nodeName types.NodeName) string {
430+
az.nodeCachesLock.RLock()
431+
defer az.nodeCachesLock.RUnlock()
432+
430433
vmName := string(nodeName)
431434
providerID, ok := az.nodeProviderIDs[vmName]
432435
if ok {

0 commit comments

Comments
 (0)