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
66 changes: 5 additions & 61 deletions .github/workflows/sandbox-sanity-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,71 +289,15 @@ jobs:
echo "========================================="
docker logs symphony-api-container --tail=100 2>&1 || echo "Could not retrieve Symphony logs"

- name: WFM-Client (K3s) Setup
- name: WFM-Client (K3s) - Setup
working-directory: scripts
run: |
sudo -E bash ./device-agent.sh k3s install
sudo -E bash ./device-agent.sh k3s create-rsa-certs
sudo -E bash ./device-agent.sh k3s create-ecdsa-certs

- name: Configure CoreDNS for k3s
run: |
RUNNER_IP=${RUNNER_IP}
echo "📡 Configuring CoreDNS with custom DNS entries..."

# Retry logic for ConfigMap update
for RETRY in {1..3}; do
echo "Attempt $RETRY to configure CoreDNS..."

# Get the full ConfigMap YAML
sudo KUBECONFIG=/etc/rancher/k3s/k3s.yaml \
kubectl -n kube-system get configmap coredns -o yaml > config.yaml

# Update the Corefile section
awk -v ip="$RUNNER_IP" '
/NodeHosts: \|/ {
print
getline
print " " ip " harbor.machine"
print " " ip " symphony.machine"
print
next
}
{ print }
' config.yaml > config-new.yaml

# Verify the change was made
if grep -q "harbor.machine" config-new.yaml && grep -q "symphony.machine" config-new.yaml; then
echo "✅ DNS entries added to ConfigMap"

# Apply the updated ConfigMap
sudo KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl apply -f config-new.yaml

# Restart CoreDNS
sudo KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl rollout restart deployment coredns -n kube-system
sudo KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl rollout status deployment/coredns -n kube-system --timeout=60s

# Wait longer for DNS propagation
echo "⏳ Waiting for DNS propagation..."
sleep 15

echo "✅ CoreDNS configured successfully"
break
else
echo "⚠️ DNS entries not found in updated ConfigMap, retrying..."
sleep 5
fi

if [ $RETRY -eq 3 ]; then
echo "❌ Failed to configure CoreDNS after 3 attempts"
echo "ConfigMap contents:"
cat config-new.yaml
exit 1
fi
done


- name: WFM-Client (Standalone Cluster) – Start
- name: WFM-Client (Helm-capable device) - Start
working-directory: scripts
run: |
sudo -E bash ./device-agent.sh k3s start-k3s
Expand All @@ -370,7 +314,7 @@ jobs:
sleep 2
done

- name: WFM-Client (Standalone Device) – Start
- name: WFM-Client (Compose-capable device) - Start
working-directory: scripts
run: |
sudo -E bash ./device-agent.sh docker create-rsa-certs
Expand Down Expand Up @@ -441,7 +385,7 @@ jobs:
(
echo "📋 Deploying to K3s..."
PACKAGE_ID=$(sudo -E bash ./wfm-cli.sh get-package-id-by-name "${APP_PACKAGE_NAME_K3S}" | tail -n1)
DEVICE_ID=$(sudo -E bash ./wfm-cli.sh get-device-id-by-role "Standalone Cluster" | tail -n1)
DEVICE_ID=$(sudo -E bash ./wfm-cli.sh get-device-id-by-deployment-type "helm" | tail -n1)

if [ -z "$PACKAGE_ID" ] || [ "$PACKAGE_ID" = "null" ] || [ -z "$DEVICE_ID" ] || [ "$DEVICE_ID" = "null" ]; then
echo "❌ K3s: Invalid IDs"
Expand Down Expand Up @@ -474,7 +418,7 @@ jobs:
(
echo "📋 Deploying to Docker..."
PACKAGE_ID=$(sudo -E bash ./wfm-cli.sh get-package-id-by-name "${APP_PACKAGE_NAME_DOCKER}" | tail -n1)
DEVICE_ID=$(sudo -E bash ./wfm-cli.sh get-device-id-by-role "Standalone Device" | tail -n1)
DEVICE_ID=$(sudo -E bash ./wfm-cli.sh get-device-id-by-deployment-type "compose" | tail -n1)

if [ -z "$PACKAGE_ID" ] || [ "$PACKAGE_ID" = "null" ] || [ -z "$DEVICE_ID" ] || [ "$DEVICE_ID" = "null" ]; then
echo "❌ Docker: Invalid IDs"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.buildx-cache/
vendor
12 changes: 6 additions & 6 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Default owners for everything
* @singhmj-1 @vireshnavalli
* @singhmj-1 @vireshnavalli @spulkit138

# Infra and scripts directory (CI/CD)
/scripts/ @nitparihar @sanjujunnuthula
/.github/ @nitparihar @sanjujunnuthula
/helmchart @nitparihar @sanjujunnuthula
/docker-compose @nitparihar @sanjujunnuthula
/scripts/ @nitparihar @sanjujunnuthula @rishabhrai9616
/.github/ @nitparihar @sanjujunnuthula @rishabhrai9616
/helmchart @nitparihar @sanjujunnuthula @rishabhrai9616
/docker-compose @nitparihar @sanjujunnuthula @rishabhrai9616

# All testing directories
**/testing/ @nitparihar @sanjujunnuthula
**/testing/ @nitparihar @sanjujunnuthula @rishabhrai9616

# Root LICENSE file
/LICENSE @ajcraig @phil-abb
2 changes: 2 additions & 0 deletions docker-compose/config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
logging:
# Log level (e.g., DEBUG, INFO, WARN, ERROR, FATAL)
level: DEBUG
database:
dataDir: "/var/lib/margo/device-agent/data" # directory where databse data is stored.

# The device's root identity/attestation used for onboarding/registration of this device client with WFM (for auto-onboarding).
deviceRootIdentity:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
- ./config/device-ecdsa.key:/config/device-ecdsa.key
- ./config/device-ecdsa.crt:/config/device-ecdsa.crt
- ./config/ca-cert.pem:/config/ca-cert.pem
- ./data:/data
- ./data:/var/lib/margo/device-agent/data #should be changed to whatever is set as dataDir in config.yaml for device agent
restart: unless-stopped
entrypoint: ["./device-agent"]
command: ["-config", "config/config.yaml"]
Binary file modified docs/margo-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/overlay-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 5 additions & 52 deletions docs/setup-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
| VM Type | Processors(vCPU) | Memory | Storage | Purpose |
|---------|-----------|--------|---------|---------|
| **Main VM (WFM)** | 8 | 16GB | 100GB | Workload Fleet Manager |
| **Device VM 1 (Standalone Cluster)** | 4 | 4-8GB | 50GB | Kubernetes-based device |
| **Device VM 2 (Standalone Device)** | 4 | 4-8GB | 50GB | Docker-based device |
| **Device VM 1 (Helm-capable device)** | 4 | 4-8GB | 50GB | Kubernetes-based device |
| **Device VM 2 (Compose-capable device)** | 4 | 4-8GB | 50GB | Docker-based device |

**Requirements:**
- Ubuntu operating system (**ubuntu-24.04.3-desktop-amd64 or server**) (you can check by doing ```cat /etc/os-release```)
Expand Down Expand Up @@ -261,68 +261,21 @@ On each VM, you need to configure environment variables (settings that tell the
cd $HOME/workspace/sandbox/scripts
```

2. **Configure the domain/host(name) resolution in coredns**

The k3s based setups don't pick the changes from `/etc/hosts` system file, hence it is better to add hostname details in the the coredns config itself.

2.1. Fetch the coredns config first:
```bash
sudo kubectl -n kube-system edit configmap coredns
```

2.2. Then add only the highlighted lines in the `NodeHosts` section with your IP addresses in them and save:
```yaml
apiVersion: v1
data:
Corefile: |
.:53 {
errors
health
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
}
hosts /etc/coredns/NodeHosts {
ttl 60
reload 15s
fallthrough
}
prometheus :9153
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
import /etc/coredns/custom/*.override
}
import /etc/coredns/custom/*.server
NodeHosts: |
20.11.000.000 harbor.machine # Newly added line to resolve harbor.machine
20.11.000.000 symphony.machine # Newly added line to resolve symphony.machine
10.0.0.11 margo-wfm-v10
```

2.3. Then apply the changes:
```bash
sudo kubectl -n kube-system rollout restart deployment coredns
```

3. **Start the device's Workload Fleet Management Client**
2. **Start the device's Workload Fleet Management Client**
```bash
sudo -E bash device-agent.sh k3s
```
- Type `5` and press Enter
- Choose: `Option 5: Device-agent-Start(k3s-device)`

4. **Check device status**
3. **Check device status**
```bash
sudo -E bash device-agent.sh k3s
```
- Type `7` and press Enter
- Choose: `Option 7: Device-agent-Status`

5. **View device logs**
4. **View device logs**
```bash
# View the logs (replace <pod-name> with actual pod name from above using #7)
sudo kubectl logs -f <pod-name> -n default
Expand Down
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ require (
github.com/docker/compose/v2 v2.40.2
github.com/docker/docker v28.5.2+incompatible
github.com/go-git/go-git/v5 v5.19.1
github.com/go-playground/validator/v10 v10.14.1
github.com/go-playground/validator/v10 v10.20.0
github.com/google/go-containerregistry v0.20.6
github.com/google/uuid v1.6.0
github.com/kr/pretty v0.3.1
github.com/lestrrat-go/htmsig v1.0.0
github.com/oapi-codegen/runtime v1.1.1
github.com/oapi-codegen/runtime v1.6.0
github.com/stretchr/testify v1.11.1
go.uber.org/zap v1.27.0
gopkg.in/yaml.v2 v2.4.0
Expand Down Expand Up @@ -93,9 +93,9 @@ require (
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/cloudflare/circl v1.6.3 // indirect
github.com/containerd/console v1.0.5 // indirect
github.com/containerd/containerd v1.7.32 // indirect
github.com/containerd/containerd v1.7.33 // indirect
github.com/containerd/containerd/api v1.10.0 // indirect
github.com/containerd/containerd/v2 v2.2.1 // indirect
github.com/containerd/containerd/v2 v2.2.5 // indirect
github.com/containerd/continuity v0.4.5 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
Expand All @@ -122,7 +122,7 @@ require (
github.com/fsnotify/fsevents v0.2.0 // indirect
github.com/fvbommel/sortorder v1.1.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.9.0 // indirect
Expand Down Expand Up @@ -162,11 +162,11 @@ require (
github.com/jonboulle/clockwork v0.5.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.18.4 // indirect
github.com/klauspost/compress v1.18.5 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
github.com/lestrrat-go/dsig v1.0.0 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
Expand Down Expand Up @@ -256,13 +256,13 @@ require (
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
go.uber.org/multierr v1.11.0
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.50.0 // indirect
golang.org/x/net v0.53.0 // indirect
golang.org/x/crypto v0.53.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/oauth2 v0.35.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.43.0 // indirect
golang.org/x/term v0.42.0 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/sync v0.21.0 // indirect
golang.org/x/sys v0.46.0 // indirect
golang.org/x/term v0.44.0 // indirect
golang.org/x/text v0.38.0 // indirect
golang.org/x/time v0.14.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
Expand All @@ -282,7 +282,7 @@ require (
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
k8s.io/kubectl v0.35.1 // indirect
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
oras.land/oras-go/v2 v2.6.0 // indirect
oras.land/oras-go/v2 v2.6.1 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/kustomize/api v0.20.1 // indirect
sigs.k8s.io/kustomize/kyaml v0.20.1 // indirect
Expand Down
Loading
Loading