diff --git a/.github/workflows/build-and-release-dde.yml b/.github/workflows/build-and-release-dde.yml index aeb3715a0cb..2ff99e18a58 100644 --- a/.github/workflows/build-and-release-dde.yml +++ b/.github/workflows/build-and-release-dde.yml @@ -59,9 +59,9 @@ jobs: name: Build and Push uses: docker/build-push-action@v2 with: + platforms: linux/amd64 context: "{{defaultContext}}:install/docker-desktop-extension" push: true - platforms: linux/amd64,linux/arm64,linux/386 tags: ${{ steps.meta.outputs.tags }} - diff --git a/install/docker-desktop-extension/Dockerfile b/install/docker-desktop-extension/Dockerfile index 1c6e7d9ce9f..280eb405414 100644 --- a/install/docker-desktop-extension/Dockerfile +++ b/install/docker-desktop-extension/Dockerfile @@ -3,6 +3,7 @@ ENV CGO_ENABLED=0 RUN apk add --update make WORKDIR /backend COPY go.* . +ARG TARGETARCH RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ go mod download @@ -16,6 +17,7 @@ WORKDIR /ui # cache packages in layer COPY ui/package.json /ui/package.json COPY ui/package-lock.json /ui/package-lock.json +ARG TARGETARCH RUN --mount=type=cache,target=/usr/src/app/.npm \ npm set cache /usr/src/app/.npm && \ npm ci @@ -24,6 +26,8 @@ COPY ui /ui RUN npm run build FROM alpine +ARG GIT_VERSION +ARG GIT_STRIPPED_VERSION LABEL org.opencontainers.image.title="meshery" \ org.opencontainers.image.description="Meshery" \ org.opencontainers.image.vendor="Layer5, Inc." \ @@ -31,6 +35,14 @@ LABEL org.opencontainers.image.title="meshery" \ COPY --from=builder /backend/bin/service / COPY docker-compose.yaml . COPY metadata.json . +RUN mkdir -p /mesheryctl/darwin && mkdir -p /mesheryctl/windows && mkdir -p /mesheryctl/linux +ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip /mesheryctl/darwin/ +# ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_arm64.zip /mesheryctl/darwin/ +ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Windows_x86_64.zip /mesheryctl/windows/ +ADD https://github.com/meshery/meshery/releases/download/$GIT_VERSION/mesheryctl_${GIT_STRIPPED_VERSION}_Linux_x86_64.zip /mesheryctl/linux/ +RUN unzip /mesheryctl/darwin/mesheryctl_${GIT_STRIPPED_VERSION}_Darwin_x86_64.zip -d /mesheryctl/darwin/ +RUN unzip /mesheryctl/windows/mesheryctl_${GIT_STRIPPED_VERSION}_Windows_x86_64.zip -d /mesheryctl/windows/ +RUN unzip /mesheryctl/linux/mesheryctl_${GIT_STRIPPED_VERSION}_Linux_x86_64.zip -d /mesheryctl/linux/ COPY meshery-logo-light.svg . COPY --from=client-builder /ui/build ui CMD /service -socket /run/guest-services/extension-meshery.sock diff --git a/install/docker-desktop-extension/Makefile b/install/docker-desktop-extension/Makefile index d94c41f9b5a..2d12ef9fa97 100644 --- a/install/docker-desktop-extension/Makefile +++ b/install/docker-desktop-extension/Makefile @@ -6,6 +6,8 @@ STATIC_FLAGS=CGO_ENABLED=0 LDFLAGS="-s -w" GO_BUILD=$(STATIC_FLAGS) go build -trimpath -ldflags=$(LDFLAGS) +GIT_VERSION=$(shell git describe --tags `git rev-list --tags --max-count=1`) +GIT_STRIPPED_VERSION=$(shell git describe --tags `git rev-list --tags --max-count=1` | cut -c 2-) INFO_COLOR = \033[0;36m NO_COLOR = \033[m @@ -14,7 +16,7 @@ bin: ## Build the binary for the current platform $(GO_BUILD) -o bin/service ./vm extension: ## Build service image to be deployed as a desktop extension - docker build --tag=$(IMAGE) . + docker build --tag=$(IMAGE) --build-arg GIT_VERSION=$(GIT_VERSION) --build-arg GIT_STRIPPED_VERSION=$(GIT_STRIPPED_VERSION) . prepare-buildx: ## Create buildx builder for multi-arch build, if not exists docker buildx inspect $(BUILDER) || docker buildx create --name=$(BUILDER) --driver=docker-container --driver-opt=network=host diff --git a/install/docker-desktop-extension/metadata.json b/install/docker-desktop-extension/metadata.json index 50002dc816d..460bdf0167b 100644 --- a/install/docker-desktop-extension/metadata.json +++ b/install/docker-desktop-extension/metadata.json @@ -17,5 +17,26 @@ "socket": "extension-meshery.sock" } } + }, + "host": { + "binaries": [ + { + "darwin": [ + { + "path": "/mesheryctl/darwin/mesheryctl" + } + ], + "windows": [ + { + "path": "/mesheryctl/windows/mesheryctl.exe" + } + ], + "linux": [ + { + "path": "/mesheryctl/linux/mesheryctl" + } + ] + } + ] } } diff --git a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js index 4625313283e..2909ddb1eb9 100644 --- a/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js +++ b/install/docker-desktop-extension/ui/src/components/ExtensionComponent.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, {useState} from "react"; import PropTypes from "prop-types"; import { withStyles } from "@material-ui/core/styles"; import { NoSsr, Typography, Grid, Link } from "@material-ui/core"; @@ -7,14 +7,15 @@ import MesheryLogo from "../img/meshery-logo/meshery-logo.svg"; import { makeStyles } from "@material-ui/core/styles"; import { Container, - Button, Paper + Button, Paper, Switch } from "@material-ui/core"; -import TwitterIcon from '@material-ui/icons/Twitter'; -import GitHubIcon from '@material-ui/icons/GitHub'; -import LinkedInIcon from '@material-ui/icons/LinkedIn'; -import GoogleIcon from "../img/SVGs/googleIcon"; +import ConsulIcon from "../img/SVGs/consulIcon"; +import IstioIcon from "../img/SVGs/IstioIcon"; +import KumaIcon from "../img/SVGs/kumaIcon"; +import LinkerdIcon from "../img/SVGs/linkerdIcon"; +import NginxIcon from "../img/SVGs/nginxIcon"; import MesheryIcon from "../img/meshery-logo/CustomMesheryLogo"; - +import { CustomTypography } from "./CustomTypography"; const useStyles = makeStyles((theme) => ({ root: { @@ -26,8 +27,12 @@ const useStyles = makeStyles((theme) => ({ main: { margin: theme.spacing(5), backgroundColor: "#393F49", - borderRadius: "5px ", - padding: "1rem" + borderRadius: "20px ", + padding: "1rem", + height: "300px", + [theme.breakpoints.down("xs")]: { + height: "400px", + }, }, paper: { padding: theme.spacing(1.5), @@ -40,10 +45,42 @@ const useStyles = makeStyles((theme) => ({ padding: "2rem", }, + serviceMeshAdapters: { + width: "50%", + float: "right", + [theme.breakpoints.down("xs")]: { + width: "100%" + } + }, + account: { + width: "50%", + float: "left", + }, + sm: { + width: "16%", + float: "left", + flexDirection: "row", + padding: "0.3rem" + }, + subText: { + color: "#AAAAAA", + padding: "0.7rem" + }, + headText: { + maxWidth: "60%", + margin: "auto", + padding: "1rem" + }, button: { padding: "0.5rem" }, - + inactiveAdapter: { + filter: "grayscale(1) invert(0.35)" + }, + mesheryConfig: { + backgroundColor: "#7794AB", + color: "#FFFFFF", + }, Icon: { width: theme.spacing(2.5), paddingRight: theme.spacing(0.5), @@ -51,50 +88,67 @@ const useStyles = makeStyles((theme) => ({ })); const ExtensionsComponent = props => { - + const [consulChecked, isConsulChecked] = useState(true); + const [istioChecked, isIstioChecked] = useState(false); + const [linkerdChecked, isLinkerdChecked] = useState(false); + const [nginxChecked, isNginxChecked] = useState(false); + const [kumaChecked, isKumaChecked] = useState(false); const classes = useStyles(); + // Wrote separate functions since we need these functions to provision the adapters as well + const handleConsul = () => { + isConsulChecked(prev => !prev); + } + const handleIstio = () => { + isIstioChecked(prev => !prev); + } + const handleLinkerd = () => { + isLinkerdChecked(prev => !prev); + } + const handleNginx = () => { + isNginxChecked(prev => !prev); + } + const handleKuma = () => { + isKumaChecked(prev => !prev); + } + + return (
- + + Design and operate your cloud native deployments with the extensible management plane, Meshery.
- - + + + CONFIGURE YOUR MESHERY DEPLOYMENT +
+
+ Account +
+
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
+
+ Deploy a Service Mesh +
+
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
diff --git a/install/docker-desktop-extension/ui/src/img/meshery-logo/CustomMesheryLogo.js b/install/docker-desktop-extension/ui/src/img/meshery-logo/CustomMesheryLogo.js index ac2bcf32b27..cfc7071920e 100644 --- a/install/docker-desktop-extension/ui/src/img/meshery-logo/CustomMesheryLogo.js +++ b/install/docker-desktop-extension/ui/src/img/meshery-logo/CustomMesheryLogo.js @@ -1,44 +1,48 @@ import React from "react"; const MesheryIcon = () => ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + diff --git a/mesheryctl/internal/cli/root/system/testdata/context/addExpected.golden b/mesheryctl/internal/cli/root/system/testdata/context/addExpected.golden index c9720e4db95..1d59d83b341 100644 --- a/mesheryctl/internal/cli/root/system/testdata/context/addExpected.golden +++ b/mesheryctl/internal/cli/root/system/testdata/context/addExpected.golden @@ -30,6 +30,7 @@ contexts: - meshery-osm - meshery-traefik-mesh - meshery-nginx-sm + - meshery-cilium channel: stable version: latest current-context: local diff --git a/mesheryctl/pkg/utils/helpers_test.go b/mesheryctl/pkg/utils/helpers_test.go index cf1a90fcddf..be57af922c0 100644 --- a/mesheryctl/pkg/utils/helpers_test.go +++ b/mesheryctl/pkg/utils/helpers_test.go @@ -579,6 +579,9 @@ func TestSetOverrideValues(t *testing.T) { "meshery-istio": map[string]interface{}{ "enabled": true, }, + "meshery-cilium": map[string]interface{}{ + "enabled": false, + }, "meshery-linkerd": map[string]interface{}{ "enabled": false, }, @@ -612,7 +615,7 @@ func TestSetOverrideValues(t *testing.T) { name: "Context contains all available components and meshery image version", ctx: &config.Context{ Components: []string{"meshery-istio", "meshery-linkerd", "meshery-consul", "meshery-kuma", - "meshery-osm", "meshery-nsm", "meshery-nginx-sm", "meshery-traefik-mesh", "meshery-cpx"}, + "meshery-osm", "meshery-nsm", "meshery-nginx-sm", "meshery-traefik-mesh", "meshery-cpx", "meshery-cilium"}, Channel: testChannel, }, mesheryImageVersion: "testImageVersion", @@ -623,6 +626,9 @@ func TestSetOverrideValues(t *testing.T) { "meshery-istio": map[string]interface{}{ "enabled": true, }, + "meshery-cilium": map[string]interface{}{ + "enabled": true, + }, "meshery-linkerd": map[string]interface{}{ "enabled": true, }, @@ -658,7 +664,7 @@ func TestSetOverrideValues(t *testing.T) { got := SetOverrideValues(tt.ctx, tt.mesheryImageVersion) eq := reflect.DeepEqual(got, tt.want) if !eq { - t.Errorf("ReadToken got = %v want = %v", got, tt.want) + t.Errorf("SetOverrideValues %s got = %v want = %v", tt.name, got, tt.want) } } }