Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ RUN go env -w GO111MODULE=auto
RUN export CGO_ENABLED=0

# Copy source files
COPY cmd $GOPATH/src/github.com/OpenCHAMI/cloud-init/cmd
COPY docs $GOPATH/src/github.com/OpenCHAMI/cloud-init/docs
COPY pkg $GOPATH/src/github.com/OpenCHAMI/cloud-init/pkg
COPY internal $GOPATH/src/github.com/OpenCHAMI/cloud-init/internal
COPY go.mod $GOPATH/src/github.com/OpenCHAMI/cloud-init/go.mod
COPY go.sum $GOPATH/src/github.com/OpenCHAMI/cloud-init/go.sum
COPY cmd $GOPATH/src/github.com/openchami/cloud-init/cmd
COPY docs $GOPATH/src/github.com/openchami/cloud-init/docs
COPY pkg $GOPATH/src/github.com/openchami/cloud-init/pkg
COPY internal $GOPATH/src/github.com/openchami/cloud-init/internal
COPY go.mod $GOPATH/src/github.com/openchami/cloud-init/go.mod
COPY go.sum $GOPATH/src/github.com/openchami/cloud-init/go.sum

# Build the image
RUN go build -C $GOPATH/src/github.com/OpenCHAMI/cloud-init/cmd/cloud-init-server -v \
RUN go build -C $GOPATH/src/github.com/openchami/cloud-init/cmd/cloud-init-server -v \
-gcflags=all="-N -l" \
-o /usr/local/bin/cloud-init-server

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The **OpenCHAMI cloud-init service** retrieves detailed inventory information fr
---

## About / Introduction
The **OpenCHAMI Cloud-Init Service** is designed to generate cloud-init configuration for nodes in an OpenCHAMI cluster. The new design pushes the complexity of merging configurations into the cloud-init client rather than the server. This README provides instructions based on the [Demo.md](https://github.com/OpenCHAMI/cloud-init/blob/main/demo/Demo.md) file for running and testing the service.
The **OpenCHAMI Cloud-Init Service** is designed to generate cloud-init configuration for nodes in an OpenCHAMI cluster. The new design pushes the complexity of merging configurations into the cloud-init client rather than the server. This README provides instructions based on the [Demo.md](https://github.com/openchami/cloud-init/blob/main/demo/Demo.md) file for running and testing the service.

This service provides configuration data to cloud-init clients via the standard nocloud-net datasource. The service merges configuration from several sources:
- **SMD data** (or simulated data in development mode)
Expand Down
4 changes: 2 additions & 2 deletions cmd/cloud-init-server/base64_decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strings"
"testing"

"github.com/OpenCHAMI/cloud-init/internal/memstore"
"github.com/OpenCHAMI/cloud-init/pkg/cistore"
"github.com/openchami/cloud-init/internal/memstore"
"github.com/openchami/cloud-init/pkg/cistore"
)

// TestBase64Decoding tests that base64 decoding doesn't produce trailing NUL bytes
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloud-init-server/group_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"reflect"

"github.com/OpenCHAMI/cloud-init/pkg/cistore"
"github.com/go-chi/chi/v5"
"github.com/openchami/cloud-init/pkg/cistore"
)

// GetGroups godoc
Expand Down
8 changes: 4 additions & 4 deletions cmd/cloud-init-server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"net/http"

// Import to run swag.Register() to generated docs
_ "github.com/OpenCHAMI/cloud-init/docs"
"github.com/OpenCHAMI/cloud-init/internal/smdclient"
"github.com/OpenCHAMI/cloud-init/pkg/cistore"
"github.com/OpenCHAMI/cloud-init/pkg/wgtunnel"
"github.com/go-chi/chi/v5"
_ "github.com/openchami/cloud-init/docs"
"github.com/openchami/cloud-init/internal/smdclient"
"github.com/openchami/cloud-init/pkg/cistore"
"github.com/openchami/cloud-init/pkg/wgtunnel"
"github.com/rs/zerolog/log"
"github.com/swaggo/swag"
)
Expand Down
14 changes: 7 additions & 7 deletions cmd/cloud-init-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ import (
"strings"
"time"

"github.com/OpenCHAMI/cloud-init/internal/memstore"
openchami_middleware "github.com/OpenCHAMI/cloud-init/internal/middleware"
"github.com/OpenCHAMI/cloud-init/internal/quackstore"
"github.com/OpenCHAMI/cloud-init/internal/smdclient"
"github.com/OpenCHAMI/cloud-init/pkg/cistore"
"github.com/OpenCHAMI/cloud-init/pkg/wgtunnel"
"github.com/OpenCHAMI/jwtauth/v5"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
openchami_authenticator "github.com/openchami/chi-middleware/auth"
openchami_logger "github.com/openchami/chi-middleware/log"
"github.com/openchami/cloud-init/internal/memstore"
openchami_middleware "github.com/openchami/cloud-init/internal/middleware"
"github.com/openchami/cloud-init/internal/quackstore"
"github.com/openchami/cloud-init/internal/smdclient"
"github.com/openchami/cloud-init/pkg/cistore"
"github.com/openchami/cloud-init/pkg/wgtunnel"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/rs/zerolog/pkgerrors"
Expand Down Expand Up @@ -273,7 +273,7 @@ func startServer() error {
// Add middleware
router.Use(
middleware.RequestID,
middleware.RealIP,
middleware.RealIP, //nolint:staticcheck // Preserve existing proxy behavior after the chi upgrade.
middleware.Logger,
middleware.Recoverer,
middleware.StripSlashes,
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloud-init-server/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/OpenCHAMI/cloud-init/pkg/cistore"
"github.com/openchami/cloud-init/pkg/cistore"
"github.com/rs/zerolog/log"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/cloud-init-server/metadata_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"net/http"
"strings"

"github.com/OpenCHAMI/cloud-init/internal/smdclient"
"github.com/OpenCHAMI/cloud-init/pkg/cistore"
"github.com/go-chi/chi/v5"
"github.com/openchami/cloud-init/internal/smdclient"
"github.com/openchami/cloud-init/pkg/cistore"
"github.com/rs/zerolog/log"
yaml "gopkg.in/yaml.v2"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloud-init-server/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

base "github.com/Cray-HPE/hms-base"
"github.com/OpenCHAMI/cloud-init/pkg/cistore"
"github.com/openchami/cloud-init/pkg/cistore"
)

func TestGenerateHostname(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/cloud-init-server/userdata_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"net/http"

"github.com/OpenCHAMI/cloud-init/internal/smdclient"
"github.com/OpenCHAMI/cloud-init/pkg/cistore"
"github.com/go-chi/chi/v5"
"github.com/openchami/cloud-init/internal/smdclient"
"github.com/openchami/cloud-init/pkg/cistore"
"github.com/rs/zerolog/log"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/cloud-init-server/vendordata_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"net/http"

"github.com/OpenCHAMI/cloud-init/internal/smdclient"
"github.com/OpenCHAMI/cloud-init/pkg/cistore"
"github.com/go-chi/chi/v5"
"github.com/openchami/cloud-init/internal/smdclient"
"github.com/openchami/cloud-init/pkg/cistore"
"github.com/rs/zerolog/log"
)

Expand Down
6 changes: 3 additions & 3 deletions demo/proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The idea behind the cloud-init microservice is to provide `user-data`, `vendor-d


### v0.0.1
In the most current tagged release [v0.1.1](https://github.com/OpenCHAMI/cloud-init/tree/v0.1.1) the payloads are non-restrictive and have the follow format:
In the most current tagged release [v0.1.1](https://github.com/openchami/cloud-init/tree/v0.1.1) the payloads are non-restrictive and have the follow format:
```yaml
name: IDENTIFIER
cloud-init:
Expand Down Expand Up @@ -64,7 +64,7 @@ This is not ideal because if a `ComponentID` is a member of multiple groups, and


### Current Main
In the latest [main](https://github.com/OpenCHAMI/cloud-init) branch of cloud-init, we have made significant changes to how the `*-data` structures are generated.
In the latest [main](https://github.com/openchami/cloud-init) branch of cloud-init, we have made significant changes to how the `*-data` structures are generated.

First, the payloads for populating the cloud-init server have changed endpoints and structure. Endpoints are now `/cloud-init/groups/{IDENTIFIER}` and the structure changes on whether we are adding `user-data` or `meta-data`.
`meta-data` looks like so:
Expand Down Expand Up @@ -650,4 +650,4 @@ http://192.168.13.3:8080/compute.yaml
http://192.168.13.3:8080/x4000.yaml
```

The cloud-init client will then download each one of these in sequence and merge them on the node.
The cloud-init client will then download each one of these in sequence and merge them on the node.
46 changes: 23 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module github.com/OpenCHAMI/cloud-init
module github.com/openchami/cloud-init

go 1.26.0
go 1.26.5

require (
github.com/OpenCHAMI/jwtauth/v5 v5.0.0-20240321222802-e6cb468a2a18
github.com/OpenCHAMI/quack v0.0.3
github.com/OpenCHAMI/smd/v2 v2.18.0
github.com/go-chi/chi/v5 v5.2.4
github.com/lestrrat-go/jwx/v2 v2.1.6
github.com/go-chi/chi/v5 v5.3.1
github.com/lestrrat-go/jwx/v2 v2.1.7
github.com/marcboeker/go-duckdb v1.8.5
github.com/openchami/chi-middleware/auth v0.0.0-20240812224658-b16b83c70700
github.com/openchami/chi-middleware/log v0.0.0-20240812224658-b16b83c70700
github.com/rs/zerolog v1.34.0
github.com/openchami/smd/v2 v2.20.5
github.com/rs/zerolog v1.35.1
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.7
github.com/spf13/viper v1.20.1
Expand All @@ -27,21 +27,21 @@ require (
github.com/apache/arrow-go/v18 v18.4.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/goccy/go-json v0.10.6 // indirect
github.com/google/flatbuffers v25.2.10+incompatible // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/lestrrat-go/blackmagic v1.0.3 // indirect
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.6 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
Expand All @@ -54,7 +54,7 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/segmentio/asm v1.2.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.12.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
Expand All @@ -63,23 +63,23 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa // indirect
golang.org/x/tools v0.44.0 // indirect
golang.org/x/mod v0.36.0 // indirect
golang.org/x/sync v0.21.0 // indirect
golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6 // indirect
golang.org/x/tools v0.45.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
github.com/Cray-HPE/hms-base v1.15.1
github.com/Cray-HPE/hms-certs v1.7.0 // indirect
github.com/Cray-HPE/hms-securestorage v1.17.0 // indirect
github.com/Cray-HPE/hms-certs v1.7.1 // indirect
github.com/Cray-HPE/hms-securestorage v1.18.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.2.0 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
Expand All @@ -89,11 +89,11 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
golang.org/x/crypto v0.52.0 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
golang.org/x/crypto v0.53.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/text v0.37.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/sys v0.46.0 // indirect
golang.org/x/text v0.38.0 // indirect
golang.org/x/time v0.12.0 // indirect
gopkg.in/yaml.v2 v2.4.0
)
Loading
Loading