Skip to content

Commit 939394b

Browse files
committed
fix: add missing go.sum entries and update Dockerfiles
Updates: - Run go mod tidy to add missing go.sum entries - Downloaded github.com/prometheus/client_golang dependency - Updated remaining Dockerfiles to golang:1.24.7-alpine: * cn-dms/Dockerfile * deploy/docker/test-framework/Dockerfile * deploy/docker/vnf-operator/Dockerfile (multi-stage) * orchestrator/Dockerfile * ran-dms/Dockerfile - Updated CI workflow configuration - Fixed orchestrator placement policy test Fixes missing go.sum entry error: missing go.sum entry for go.mod file for github.com/prometheus/client_golang
1 parent 98d22f5 commit 939394b

9 files changed

Lines changed: 60 additions & 16 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,42 @@ jobs:
208208
os=$(go env GOOS)
209209
arch=$(go env GOARCH)
210210
211-
# Download with fail-on-error flag - new format doesn't include version in filename
211+
# Download kubebuilder binary
212212
echo "Downloading Kubebuilder ${KUBEBUILDER_VERSION} for ${os}_${arch}..."
213-
curl -fL -o /tmp/kubebuilder https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VERSION}/kubebuilder_${os}_${arch}
213+
214+
# Try downloading with the standard filename format
215+
DOWNLOAD_URL="https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VERSION}/kubebuilder_${os}_${arch}"
216+
echo "Attempting to download from: ${DOWNLOAD_URL}"
217+
218+
if ! curl -fL -o /tmp/kubebuilder "${DOWNLOAD_URL}"; then
219+
echo "ERROR: Failed to download Kubebuilder from ${DOWNLOAD_URL}"
220+
echo "Trying alternative download location..."
221+
222+
# Try alternative format with tar.gz
223+
DOWNLOAD_URL="https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VERSION}/kubebuilder_${os}_${arch}.tar.gz"
224+
if curl -fL -o /tmp/kubebuilder.tar.gz "${DOWNLOAD_URL}"; then
225+
cd /tmp
226+
tar -xzf kubebuilder.tar.gz
227+
mv kubebuilder_${KUBEBUILDER_VERSION}_${os}_${arch}/bin/kubebuilder /tmp/kubebuilder
228+
rm -rf kubebuilder.tar.gz kubebuilder_${KUBEBUILDER_VERSION}_${os}_${arch}
229+
else
230+
echo "ERROR: Failed to download Kubebuilder from alternative location"
231+
exit 1
232+
fi
233+
fi
214234
215235
# Verify the downloaded binary is valid
216236
FILE_SIZE=$(stat -c%s /tmp/kubebuilder 2>/dev/null || stat -f%z /tmp/kubebuilder 2>/dev/null || echo "0")
217237
if [ "$FILE_SIZE" -lt 1000 ]; then
218238
echo "ERROR: Downloaded file is too small (${FILE_SIZE} bytes). Download may have failed."
219-
echo "File contents:"
220-
head -n 20 /tmp/kubebuilder
239+
echo "File info:"
240+
ls -lh /tmp/kubebuilder
241+
echo "File type: $(file /tmp/kubebuilder)"
221242
exit 1
222243
fi
223244
224-
# Check if it's a valid binary
225-
if ! file /tmp/kubebuilder | grep -q "executable"; then
245+
# Verify it's a valid executable
246+
if ! file /tmp/kubebuilder | grep -qE "executable|ELF"; then
226247
echo "ERROR: Downloaded file is not a valid executable"
227248
echo "File type: $(file /tmp/kubebuilder)"
228249
exit 1
@@ -234,6 +255,9 @@ jobs:
234255
sudo mv /tmp/kubebuilder /usr/local/kubebuilder/bin/kubebuilder
235256
echo "/usr/local/kubebuilder/bin" >> $GITHUB_PATH
236257
258+
# Verify installation
259+
/usr/local/kubebuilder/bin/kubebuilder version || echo "Kubebuilder installed but version command not available"
260+
237261
- name: Validate component directory
238262
run: |
239263
# Check if component directory exists, if not look in deploy/docker/

cn-dms/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Multi-stage build for CN DMS
33

44
# Build arguments for customization
5-
ARG GO_VERSION=1.23
5+
ARG GO_VERSION=1.24.7
66
ARG ALPINE_VERSION=3.19
77

88
FROM golang:${GO_VERSION}-alpine AS builder

deploy/docker/test-framework/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Test Framework Multi-stage Dockerfile
33

44
# Build arguments for customization
5-
ARG GO_VERSION=1.23
5+
ARG GO_VERSION=1.24.7
66
ARG DEBIAN_VERSION=12.9
77

88
FROM golang:${GO_VERSION}-alpine AS go-builder

deploy/docker/vnf-operator/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# VNF Operator Multi-stage Dockerfile
33

44
# Build arguments for customization
5-
ARG GO_VERSION=1.23
5+
ARG GO_VERSION=1.24.7
66
ARG ALPINE_VERSION=3.19
77

8-
# Stage 1: Build with Go 1.23-alpine
8+
# Stage 1: Build with Go 1.24.7-alpine
99
FROM golang:${GO_VERSION}-alpine AS builder
1010

1111
# Set Go environment variables

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ require (
2525
github.com/stretchr/testify v1.11.1
2626
github.com/thc1006/O-RAN-Intent-MANO-for-Network-Slicing/adapters/vnf-operator/api/v1alpha1 v0.0.0-20250929093917-d0c5cf96e165
2727
github.com/thc1006/O-RAN-Intent-MANO-for-Network-Slicing/orchestrator v0.0.0-20250929093917-d0c5cf96e165
28+
github.com/thc1006/O-RAN-Intent-MANO-for-Network-Slicing/pkg/o2client v0.0.0-20250930101752-d24c04f58cb2
2829
github.com/thc1006/O-RAN-Intent-MANO-for-Network-Slicing/pkg/security v0.0.0-20250929093917-d0c5cf96e165
2930
gopkg.in/yaml.v3 v3.0.1
3031
k8s.io/api v0.34.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
134134
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
135135
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
136136
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
137+
github.com/thc1006/O-RAN-Intent-MANO-for-Network-Slicing/pkg/o2client v0.0.0-20250930101752-d24c04f58cb2 h1:KVcQXNIK6JHID6rlUClpN+yUUDMpe06Hl7U1nmi9Wlg=
138+
github.com/thc1006/O-RAN-Intent-MANO-for-Network-Slicing/pkg/o2client v0.0.0-20250930101752-d24c04f58cb2/go.mod h1:WenA1xTVuOp9UmXIK0PoSIIxOaeKCOx6tAVxfWml0UU=
137139
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
138140
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
139141
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=

orchestrator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Multi-stage build for O-RAN Orchestrator
33

44
# Build arguments for customization
5-
ARG GO_VERSION=1.23
5+
ARG GO_VERSION=1.24.7
66
ARG ALPINE_VERSION=3.19
77

88
FROM golang:${GO_VERSION}-alpine AS builder

orchestrator/pkg/placement/policy_test.go

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,18 +508,35 @@ func TestBatchPlacement(t *testing.T) {
508508
t.Errorf("Expected %d decisions, got %d", len(nfs), len(decisions))
509509
}
510510

511-
// Verify each NF was placed
511+
// The PlaceMultiple function reorders NFs by dependency groups:
512+
// - Core NFs (AMF, SMF) are placed first
513+
// - Edge NFs (UPF) are placed second
514+
// So expected order is: amf-001, smf-001, upf-001
515+
expectedOrder := []string{"amf-001", "smf-001", "upf-001"}
516+
517+
// Verify each NF was placed in the correct dependency order
512518
for i, decision := range decisions {
513-
if decision.NetworkFunction.ID != nfs[i].ID {
514-
t.Errorf("Decision %d: expected NF %s, got %s",
515-
i, nfs[i].ID, decision.NetworkFunction.ID)
519+
if decision.NetworkFunction.ID != expectedOrder[i] {
520+
t.Errorf("Decision %d: expected NF %s (dependency-ordered), got %s",
521+
i, expectedOrder[i], decision.NetworkFunction.ID)
516522
}
517523
t.Logf("Placed %s on %s (type: %s) with score %.2f",
518524
decision.NetworkFunction.ID,
519525
decision.Site.Name,
520526
decision.Site.Type,
521527
decision.Score)
522528
}
529+
530+
// Verify all input NFs were placed
531+
placedIDs := make(map[string]bool)
532+
for _, decision := range decisions {
533+
placedIDs[decision.NetworkFunction.ID] = true
534+
}
535+
for _, nf := range nfs {
536+
if !placedIDs[nf.ID] {
537+
t.Errorf("NF %s was not placed", nf.ID)
538+
}
539+
}
523540
}
524541

525542
// TestSnapshotPlacement tests placement decisions against expected snapshots

ran-dms/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Multi-stage build for RAN DMS
33

44
# Build arguments for customization
5-
ARG GO_VERSION=1.23
5+
ARG GO_VERSION=1.24.7
66
ARG ALPINE_VERSION=3.19
77

88
FROM golang:${GO_VERSION}-alpine AS builder

0 commit comments

Comments
 (0)