From e1648425ea0983be9f74ac7dbac9023b6ee2ca5d Mon Sep 17 00:00:00 2001 From: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Date: Fri, 28 Jun 2024 08:54:44 -0300 Subject: [PATCH] chore(nomad): remove Nomad code EE-7234 (#11980) --- .../edgestacks/edgestack_create_file.go | 2 +- api/platform/platform.go | 19 ++++++------------ app/assets/ico/vendor/nomad.svg | 3 --- .../useCreateEdgeStack/createStackFromGit.ts | 2 +- .../queries/useEnvironmentList.ts | 19 +----------------- .../portainer/environments/utils/nomad.png | Bin 1439 -> 0 bytes .../portainer/environments/utils/nomad.svg | 3 --- build/linux/Dockerfile | 2 +- build/linux/alpine.Dockerfile | 2 +- 9 files changed, 11 insertions(+), 41 deletions(-) delete mode 100644 app/assets/ico/vendor/nomad.svg delete mode 100644 app/react/portainer/environments/utils/nomad.png delete mode 100644 app/react/portainer/environments/utils/nomad.svg diff --git a/api/http/handler/edgestacks/edgestack_create_file.go b/api/http/handler/edgestacks/edgestack_create_file.go index 93e1b1ea6..6575626ac 100644 --- a/api/http/handler/edgestacks/edgestack_create_file.go +++ b/api/http/handler/edgestacks/edgestack_create_file.go @@ -78,7 +78,7 @@ func (payload *edgeStackFromFileUploadPayload) Validate(r *http.Request) error { // @param Name formData string true "Name of the stack" // @param file formData file true "Content of the Stack file" // @param EdgeGroups formData string true "JSON stringified array of Edge Groups ids" -// @param DeploymentType formData int true "deploy type 0 - 'compose', 1 - 'kubernetes', 2 - 'nomad'" +// @param DeploymentType formData int true "deploy type 0 - 'compose', 1 - 'kubernetes'" // @param Registries formData string false "JSON stringified array of Registry ids to use for this stack" // @param UseManifestNamespaces formData bool false "Uses the manifest's namespaces instead of the default one, relevant only for kube environments" // @param PrePullImage formData bool false "Pre Pull image" diff --git a/api/platform/platform.go b/api/platform/platform.go index 38f000e3b..68aa1bb79 100644 --- a/api/platform/platform.go +++ b/api/platform/platform.go @@ -4,19 +4,19 @@ import ( "context" "os" + dockerclient "github.com/portainer/portainer/api/docker/client" + "github.com/docker/docker/client" "github.com/pkg/errors" - dockerclient "github.com/portainer/portainer/api/docker/client" "github.com/rs/zerolog/log" ) const ( PodmanMode = "PODMAN" KubernetesServiceHost = "KUBERNETES_SERVICE_HOST" - NomadJobName = "NOMAD_JOB_NAME" ) -// ContainerPlatform represent the platform on which the container is running (Docker, Kubernetes, Nomad) +// ContainerPlatform represent the platform on which the container is running (Docker, Kubernetes) type ContainerPlatform string const ( @@ -28,8 +28,6 @@ const ( PlatformKubernetes = ContainerPlatform("Kubernetes") // PlatformPodman represent the Podman platform (Standalone) PlatformPodman = ContainerPlatform("Podman") - // PlatformNomad represent the Nomad platform (Standalone) - PlatformNomad = ContainerPlatform("Nomad") ) // DetermineContainerPlatform will check for the existence of the PODMAN_MODE @@ -47,11 +45,6 @@ func DetermineContainerPlatform() (ContainerPlatform, error) { return PlatformKubernetes, nil } - nomadJobName := os.Getenv(NomadJobName) - if nomadJobName != "" { - return PlatformNomad, nil - } - if !isRunningInContainer() { return "", nil } @@ -65,9 +58,8 @@ func DetermineContainerPlatform() (ContainerPlatform, error) { info, err := dockerCli.Info(context.Background()) if err != nil { if client.IsErrConnectionFailed(err) { - log.Warn(). - Err(err). - Msg("failed to retrieve docker info") + log.Warn().Err(err).Msg("failed to retrieve docker info") + return "", nil } @@ -85,5 +77,6 @@ func DetermineContainerPlatform() (ContainerPlatform, error) { // this code is taken from https://github.com/moby/libnetwork/blob/master/drivers/bridge/setup_bridgenetfiltering.go func isRunningInContainer() bool { _, err := os.Stat("/.dockerenv") + return !os.IsNotExist(err) } diff --git a/app/assets/ico/vendor/nomad.svg b/app/assets/ico/vendor/nomad.svg deleted file mode 100644 index 0dcf7e3cc..000000000 --- a/app/assets/ico/vendor/nomad.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/app/react/edge/edge-stacks/queries/useCreateEdgeStack/createStackFromGit.ts b/app/react/edge/edge-stacks/queries/useCreateEdgeStack/createStackFromGit.ts index 655715248..c1943edbd 100644 --- a/app/react/edge/edge-stacks/queries/useCreateEdgeStack/createStackFromGit.ts +++ b/app/react/edge/edge-stacks/queries/useCreateEdgeStack/createStackFromGit.ts @@ -29,7 +29,7 @@ export type GitRepositoryPayload = { filePathInRepository?: string; /** List of identifiers of EdgeGroups */ edgeGroups: Array; - /** Deployment type to deploy this stack. Valid values are: 0 - 'compose', 1 - 'kubernetes', 2 - 'nomad'. Compose is enabled only for docker environments, kubernetes is enabled only for kubernetes environments, nomad is enabled only for nomad environments */ + /** Deployment type to deploy this stack. Valid values are: 0 - 'compose', 1 - 'kubernetes'. Compose is enabled only for docker environments, kubernetes is enabled only for kubernetes environments */ deploymentType: DeploymentType; /** List of Registries to use for this stack */ registries?: Array; diff --git a/app/react/portainer/environments/queries/useEnvironmentList.ts b/app/react/portainer/environments/queries/useEnvironmentList.ts index afc3f5eb6..ef545b06f 100644 --- a/app/react/portainer/environments/queries/useEnvironmentList.ts +++ b/app/react/portainer/environments/queries/useEnvironmentList.ts @@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query'; import { withError } from '@/react-tools/react-query'; -import { EnvironmentStatus, EnvironmentType } from '../types'; +import { EnvironmentStatus } from '../types'; import { EnvironmentsQueryParams, getEnvironments, @@ -82,23 +82,6 @@ export function useEnvironmentList( async () => { const start = (page - 1) * pageLimit + 1; - // Workaround for EE-6060: filter out Nomad results when no filter is applied. - // Remove when cleaning up API. - if (!query.types || query.types.length === 0) { - const environmentTypesArray: EnvironmentType[] = [ - EnvironmentType.Docker, - EnvironmentType.AgentOnDocker, - EnvironmentType.Azure, - EnvironmentType.EdgeAgentOnDocker, - EnvironmentType.KubernetesLocal, - EnvironmentType.AgentOnKubernetes, - EnvironmentType.EdgeAgentOnKubernetes, - ]; - - // eslint-disable-next-line no-param-reassign - query.types = environmentTypesArray; - } - return getEnvironments({ start, limit: pageLimit, diff --git a/app/react/portainer/environments/utils/nomad.png b/app/react/portainer/environments/utils/nomad.png deleted file mode 100644 index dcff7a91843e0e056e138bed6be858e385eb0551..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1439 zcmV;Q1z`G#P)!In200009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP1Y6^WTQG?6byiH1XR-f(_E0vR?eKtIoWFLW-~hZODLLOBLWqw1>cJ=9Ct1tn1p7y0Fov%r z723j)eAW2k&nC$kmbVet5Xeu`|9|gdbE7X`wXila1TJn*xXI!pDGhDMccD!mh9QuL zq~}jN2*P9Bmv?kg7Z=M2&EL;pId)50C+}!ue+aZw(&VoO!fle%LRln9jICgZhtUlz z!!AkhE~#Twfu;G%9!W*y9bJ^H*N<%pfz?Y&^A5>r!8+{7SJg?Pyc2BoWoUZ>+o60_ z;TBW*lD@Q+V=EQrt8yhxdu{oa6xtf#%S$X?|5|1UEJu>nc}JJ>@>Q{tJ}x1+28F;y zGQ^KZ0~AOxlDOs_T?)=u<|UP~m18T#gg|qWa+MIQg0_Wb^4~6WNs@uAUky#k3Xm5H zZI`{i6m$jdf)a6tg?K1G64dPpiev>B!zk^;yT zWaz4`0`lJ{c?!o%Vt|*#056FFUJ?VmBnEJkL}i2_(o#Zg;3Vlnl@a#39c-#{0v)lM zp$6E0Gn?(Ty}wJHp4W~s>5ma6w7Yx=hp~Gl(Q4U}tLAfM1gibe%36pWDf1sVimj3^ z)CW(SpCK+;^+u4-(X_C9Qp%=&rfq9cW}*wd@QF=KUc(N?mk zgKr-6)oNozjk+oXl`h&~h`*U-fS1GoFNpzO5(B&>26#yf;3g4)Mcdf#d7AzKL4; z@Ij3gK0k>~zDo1XRxqflW3c)sk-g}*4} - - diff --git a/build/linux/Dockerfile b/build/linux/Dockerfile index 6054f322d..76080199a 100644 --- a/build/linux/Dockerfile +++ b/build/linux/Dockerfile @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.title="Portainer" \ com.docker.desktop.extension.api.version=">= 0.2.2" \ com.docker.desktop.extension.icon="https://portainer-io-assets.sfo2.cdn.digitaloceanspaces.com/logos/portainer.png" \ com.docker.extension.screenshots="[{\"alt\": \"screenshot one\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-1.png\"},{\"alt\": \"screenshot two\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-2.png\"},{\"alt\": \"screenshot three\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-3.png\"},{\"alt\": \"screenshot four\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-4.png\"},{\"alt\": \"screenshot five\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-5.png\"},{\"alt\": \"screenshot six\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-6.png\"},{\"alt\": \"screenshot seven\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-7.png\"},{\"alt\": \"screenshot eight\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-8.png\"},{\"alt\": \"screenshot nine\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-9.png\"}]" \ - com.docker.extension.detailed-description="

Portainer’s Docker Desktop extension gives you access to all of Portainer’s rich management functionality within your docker desktop experience.

With Portainer you can:

  • See all your running containers
  • Easily view all of your container logs
  • Console into containers
  • Easily deploy your code into containers using a simple form
  • Turn your YAML into custom templates for easy reuse

About Portainer 

Portainer is the worlds’ most popular universal container management platform with more than 650,000 active monthly users. Portainer can be used to manage Docker Standalone, Kubernetes, Docker Swarm and Nomad environments through a single common interface. It includes a simple GitOps automation engine and a Kube API. 

Portainer Business Edition is our fully supported commercial grade product for business-wide use. It includes all the functionality that businesses need to manage containers at scale. Visit Portainer.io to learn more about Portainer Business and get 3 free nodes.

" \ + com.docker.extension.detailed-description="

Portainer’s Docker Desktop extension gives you access to all of Portainer’s rich management functionality within your docker desktop experience.

With Portainer you can:

  • See all your running containers
  • Easily view all of your container logs
  • Console into containers
  • Easily deploy your code into containers using a simple form
  • Turn your YAML into custom templates for easy reuse

About Portainer 

Portainer is the worlds’ most popular universal container management platform with more than 650,000 active monthly users. Portainer can be used to manage Docker Standalone, Kubernetes and Docker Swarm environments through a single common interface. It includes a simple GitOps automation engine and a Kube API. 

Portainer Business Edition is our fully supported commercial grade product for business-wide use. It includes all the functionality that businesses need to manage containers at scale. Visit Portainer.io to learn more about Portainer Business and get 3 free nodes.

" \ com.docker.extension.publisher-url="https://www.portainer.io" \ com.docker.extension.additional-urls="[{\"title\":\"Website\",\"url\":\"https://www.portainer.io?utm_campaign=DockerCon&utm_source=DockerDesktop\"},{\"title\":\"Documentation\",\"url\":\"https://docs.portainer.io\"},{\"title\":\"Support\",\"url\":\"https://join.slack.com/t/portainer/shared_invite/zt-txh3ljab-52QHTyjCqbe5RibC2lcjKA\"}]" diff --git a/build/linux/alpine.Dockerfile b/build/linux/alpine.Dockerfile index 69dd53b20..08c094bdc 100644 --- a/build/linux/alpine.Dockerfile +++ b/build/linux/alpine.Dockerfile @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.title="Portainer" \ com.docker.desktop.extension.api.version=">= 0.2.2" \ com.docker.desktop.extension.icon="https://portainer-io-assets.sfo2.cdn.digitaloceanspaces.com/logos/portainer.png" \ com.docker.extension.screenshots="[{\"alt\": \"screenshot one\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-1.png\"},{\"alt\": \"screenshot two\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-2.png\"},{\"alt\": \"screenshot three\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-3.png\"},{\"alt\": \"screenshot four\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-4.png\"},{\"alt\": \"screenshot five\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-5.png\"},{\"alt\": \"screenshot six\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-6.png\"},{\"alt\": \"screenshot seven\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-7.png\"},{\"alt\": \"screenshot eight\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-8.png\"},{\"alt\": \"screenshot nine\", \"url\": \"https://portainer-io-assets.sfo2.digitaloceanspaces.com/screenshots/docker-extension-9.png\"}]" \ - com.docker.extension.detailed-description="

Portainer’s Docker Desktop extension gives you access to all of Portainer’s rich management functionality within your docker desktop experience.

With Portainer you can:

  • See all your running containers
  • Easily view all of your container logs
  • Console into containers
  • Easily deploy your code into containers using a simple form
  • Turn your YAML into custom templates for easy reuse

About Portainer 

Portainer is the worlds’ most popular universal container management platform with more than 650,000 active monthly users. Portainer can be used to manage Docker Standalone, Kubernetes, Docker Swarm and Nomad environments through a single common interface. It includes a simple GitOps automation engine and a Kube API. 

Portainer Business Edition is our fully supported commercial grade product for business-wide use. It includes all the functionality that businesses need to manage containers at scale. Visit Portainer.io to learn more about Portainer Business and get 3 free nodes.

" \ + com.docker.extension.detailed-description="

Portainer’s Docker Desktop extension gives you access to all of Portainer’s rich management functionality within your docker desktop experience.

With Portainer you can:

  • See all your running containers
  • Easily view all of your container logs
  • Console into containers
  • Easily deploy your code into containers using a simple form
  • Turn your YAML into custom templates for easy reuse

About Portainer 

Portainer is the worlds’ most popular universal container management platform with more than 650,000 active monthly users. Portainer can be used to manage Docker Standalone, Kubernetes and Docker Swarm environments through a single common interface. It includes a simple GitOps automation engine and a Kube API. 

Portainer Business Edition is our fully supported commercial grade product for business-wide use. It includes all the functionality that businesses need to manage containers at scale. Visit Portainer.io to learn more about Portainer Business and get 3 free nodes.

" \ com.docker.extension.publisher-url="https://www.portainer.io" \ com.docker.extension.additional-urls="[{\"title\":\"Website\",\"url\":\"https://www.portainer.io?utm_campaign=DockerCon&utm_source=DockerDesktop\"},{\"title\":\"Documentation\",\"url\":\"https://docs.portainer.io\"},{\"title\":\"Support\",\"url\":\"https://join.slack.com/t/portainer/shared_invite/zt-txh3ljab-52QHTyjCqbe5RibC2lcjKA\"}]"