Skip to content

Commit

Permalink
treewide: move contrast-node-installer-image to new directory structure.
Browse files Browse the repository at this point in the history
This also pulls out the node installer image to the new directory structure, as it also only holds Microsoft-specific components. A future refactoring should make this share the lowest layer (i.e. the node installer binary itself) between flavour-specific node installers.
  • Loading branch information
msanft committed Jun 19, 2024
1 parent 2a85e95 commit 53a71bf
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e_getdents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
just get-credentials
- name: Build and prepare deployments
run: |
just node-installer
just microsoft-node-installer
- name: E2E Test
run: |
nix shell .#contrast.e2e --command getdents.test -test.v \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
echo "SYNC_FIFO_UUID=$sync_uuid" | tee -a $GITHUB_ENV
- name: Build and prepare deployments
run: |
just coordinator initializer openssl port-forwarder node-installer
just coordinator initializer openssl port-forwarder microsoft-node-installer
- name: E2E Test
run: |
nix shell .#contrast.e2e --command openssl.test -test.v \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_servicemesh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
echo "SYNC_FIFO_UUID=$sync_uuid" | tee -a $GITHUB_ENV
- name: Build and prepare deployments
run: |
just coordinator initializer port-forwarder service-mesh-proxy node-installer
just coordinator initializer port-forwarder service-mesh-proxy microsoft-node-installer
- name: E2E Test
run: |
nix shell .#contrast.e2e --command servicemesh.test -test.v \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ jobs:
- name: Push containers with release tag
run: |
coordinatorImg=$(nix run .#containers.push-coordinator -- "$container_registry/contrast/coordinator")
nodeInstallerImg=$(nix run .#containers.push-node-installer -- "$container_registry/contrast/node-installer")
nodeInstallerImg=$(nix run .#containers.push-microsoft-node-installer -- "$container_registry/contrast/microsoft-node-installer")
initializerImg=$(nix run .#containers.push-initializer -- "$container_registry/contrast/initializer")
serviceMeshImg=$(nix run .#containers.push-service-mesh-proxy -- "$container_registry/contrast/service-mesh-proxy")
echo "coordinatorImg=$coordinatorImg" | tee -a "$GITHUB_ENV"
Expand All @@ -257,7 +257,7 @@ jobs:
echo "ghcr.io/edgelesssys/contrast/coordinator:latest=$coordinatorImgTagged" > image-replacements.txt
echo "ghcr.io/edgelesssys/contrast/initializer:latest=$initializerImgTagged" >> image-replacements.txt
echo "ghcr.io/edgelesssys/contrast/service-mesh-proxy:latest=$serviceMeshImgTagged" >> image-replacements.txt
echo "ghcr.io/edgelesssys/contrast/node-installer:latest=$nodeInstallerImgTagged" >> image-replacements.txt
echo "ghcr.io/edgelesssys/contrast/microsoft-node-installer:latest=$nodeInstallerImgTagged" >> image-replacements.txt
- name: Upload image replacements file (for main branch PR)
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
Expand Down
2 changes: 1 addition & 1 deletion e2e/internal/contrasttest/contrasttest.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (ct *ContrastTest) installRuntime(t *testing.T) {

require.NoError(ct.Kubeclient.Apply(ctx, unstructuredResources...))

require.NoError(ct.Kubeclient.WaitForDaemonset(ctx, ct.Namespace, "contrast-node-installer"))
require.NoError(ct.Kubeclient.WaitForDaemonset(ctx, ct.Namespace, "contrast-node-installer-microsoft"))
}

func makeNamespace(t *testing.T) string {
Expand Down
2 changes: 1 addition & 1 deletion e2e/release/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestRelease(t *testing.T) {
require.NoError(err)

require.NoError(k.Apply(ctx, resources...))
require.NoError(k.WaitForDaemonset(ctx, "kube-system", "contrast-node-installer"))
require.NoError(k.WaitForDaemonset(ctx, "kube-system", "contrast-node-installer-microsoft"))
}), "the runtime is required for subsequent tests to run")

var coordinatorIP string
Expand Down
4 changes: 2 additions & 2 deletions internal/kuberesource/parts.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type NodeInstallerConfig struct {

// NodeInstaller constructs a node installer daemon set.
func NodeInstaller(namespace string) *NodeInstallerConfig {
name := "contrast-node-installer"
name := "contrast-node-installer-microsoft"

d := DaemonSet(name, namespace).
WithLabels(map[string]string{"app.kubernetes.io/name": name}).
Expand All @@ -42,7 +42,7 @@ func NodeInstaller(namespace string) *NodeInstallerConfig {
).
WithTemplate(PodTemplateSpec().
WithLabels(map[string]string{"app.kubernetes.io/name": name}).
WithAnnotations(map[string]string{"contrast.edgeless.systems/pod-role": "contrast-node-installer"}).
WithAnnotations(map[string]string{"contrast.edgeless.systems/pod-role": "contrast-node-installer-microsoft"}).
WithSpec(PodSpec().
WithHostPID(true).
WithInitContainers(Container().
Expand Down
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Undeploy, rebuild, deploy.
default target=default_deploy_target cli=default_cli: soft-clean coordinator initializer openssl port-forwarder service-mesh-proxy node-installer runtime (apply "runtime") (deploy target cli) set verify (wait-for-workload target)
default target=default_deploy_target cli=default_cli: soft-clean coordinator initializer openssl port-forwarder service-mesh-proxy microsoft-node-installer runtime (apply "runtime") (deploy target cli) set verify (wait-for-workload target)

# Build and push a container image.
push target:
Expand All @@ -21,14 +21,14 @@ service-mesh-proxy: (push "service-mesh-proxy")
# Build the initializer, containerize and push it.
initializer: (push "initializer")

# Build the node-installer, containerize and push it.
node-installer: (push "node-installer")
# Build the microsoft-node-installer, containerize and push it.
microsoft-node-installer: (push "microsoft-node-installer")

default_cli := "contrast.cli"
default_deploy_target := "openssl"
workspace_dir := "workspace"

e2e target=default_deploy_target: coordinator initializer openssl port-forwarder service-mesh-proxy node-installer
e2e target=default_deploy_target: coordinator initializer openssl port-forwarder service-mesh-proxy microsoft-node-installer
#!/bin/env bash
case {{ target }} in
"openssl" | "servicemesh")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ let
};
extraManifest = {
"annotations" = {
"org.opencontainers.image.title" = "contrast-node-installer";
"org.opencontainers.image.description" = "Contrast Node Installer";
"org.opencontainers.image.title" = "contrast-node-installer-microsoft";
"org.opencontainers.image.description" = "Contrast Node Installer (Microsoft)";
"systems.edgeless.contrast.snp-launch-digest" = launch-digest;
};
};
Expand Down
2 changes: 1 addition & 1 deletion packages/containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ let
};
in
containers // {
push-node-installer = pushOCIDir "push-node-installer" pkgs.contrast-node-installer-image "v${pkgs.contrast.version}";
push-microsoft-node-installer = pushOCIDir "push-microsoft-node-installer" pkgs.microsoft.contrast-node-installer-image "v${pkgs.contrast.version}";
} // (
lib.concatMapAttrs (name: container: { "push-${name}" = pushContainer container; }) containers
)

0 comments on commit 53a71bf

Please sign in to comment.