From 7c60c4be652ff81656663f71352e7b4856939bcd Mon Sep 17 00:00:00 2001 From: Drew Blessing Date: Thu, 2 May 2019 20:39:41 +0000 Subject: Add AWS ELB note about not supporting web sockets --- doc/administration/integration/terminal.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/administration/integration/terminal.md b/doc/administration/integration/terminal.md index 2596e3fe68b..c34858cd0db 100644 --- a/doc/administration/integration/terminal.md +++ b/doc/administration/integration/terminal.md @@ -43,6 +43,11 @@ detail below. ## Enabling and disabling terminal support +NOTE: **Note:** AWS Elastic Load Balancers (ELBs) do not support web sockets. +AWS Application Load Balancers (ALBs) must be used if you want web terminals +to work. See [AWS Elastic Load Balancing Product Comparison](https://aws.amazon.com/elasticloadbalancing/features/#compare) +for more information. + As web terminals use WebSockets, every HTTP/HTTPS reverse proxy in front of Workhorse needs to be configured to pass the `Connection` and `Upgrade` headers through to the next one in the chain. If you installed GitLab using Omnibus, or -- cgit v1.2.1 From 0d62d9bcab0a20df7fca087d0904f90344e37227 Mon Sep 17 00:00:00 2001 From: Tim Rizzi Date: Mon, 27 May 2019 18:26:03 +0000 Subject: Update maven.gitlab-ci.yml for GitLab Package --- lib/gitlab/ci/templates/Maven.gitlab-ci.yml | 68 ++++------------------------- 1 file changed, 9 insertions(+), 59 deletions(-) diff --git a/lib/gitlab/ci/templates/Maven.gitlab-ci.yml b/lib/gitlab/ci/templates/Maven.gitlab-ci.yml index c9838c7a7ff..f0432eefce1 100644 --- a/lib/gitlab/ci/templates/Maven.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Maven.gitlab-ci.yml @@ -1,18 +1,11 @@ ---- +# This file is a template, and might need editing before it works on your project. # Build JAVA applications using Apache Maven (http://maven.apache.org) # For docker image tags see https://hub.docker.com/_/maven/ -# # For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html -# -# This template will build and test your projects as well as create the documentation. -# +# This template will build and test your projects # * Caches downloaded dependencies and plugins between invocation. # * Verify but don't deploy merge requests. # * Deploy built artifacts from master branch only. -# * Shows how to use multiple jobs in test stage for verifying functionality -# with multiple JDKs. -# * Uses site:stage to collect the documentation for multi-module projects. -# * Publishes the documentation for `master` branch. variables: # This will suppress any download for dependencies and plugins or upload messages which would clutter the console log. @@ -29,72 +22,29 @@ cache: paths: - .m2/repository -# This will only validate and compile stuff and run e.g. maven-enforcer-plugin. -# Because some enforcer rules might check dependency convergence and class duplications -# we use `test-compile` here instead of `validate`, so the correct classpath is picked up. -.validate: &validate - stage: build - script: - - 'mvn $MAVEN_CLI_OPTS test-compile' - # For merge requests do not `deploy` but only run `verify`. # See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html .verify: &verify stage: test script: - - 'mvn $MAVEN_CLI_OPTS verify site site:stage' + - 'mvn $MAVEN_CLI_OPTS verify' except: - master -# Validate merge requests using JDK7 -validate:jdk7: - <<: *validate - image: maven:3.3.9-jdk-7 - -# Validate merge requests using JDK8 -validate:jdk8: - <<: *validate - image: maven:3.3.9-jdk-8 - -# Verify merge requests using JDK7 -verify:jdk7: - <<: *verify - image: maven:3.3.9-jdk-7 - # Verify merge requests using JDK8 verify:jdk8: <<: *verify image: maven:3.3.9-jdk-8 # For `master` branch run `mvn deploy` automatically. -# Here you need to decide whether you want to use JDK7 or 8. -# To get this working you need to define a volume while configuring your gitlab-ci-multi-runner. -# Mount your `settings.xml` as `/root/.m2/settings.xml` which holds your secrets. -# See https://maven.apache.org/settings.html deploy:jdk8: - # Use stage test here, so the pages job may later pickup the created site. - stage: test - script: - - 'mvn $MAVEN_CLI_OPTS deploy site site:stage' - only: - - master - # Archive up the built documentation site. - artifacts: - paths: - - target/staging - image: maven:3.3.9-jdk-8 - -pages: - image: busybox:latest stage: deploy script: - # Because Maven appends the artifactId automatically to the staging path if you did define a parent pom, - # you might need to use `mv target/staging/YOUR_ARTIFACT_ID public` instead. - - mv target/staging public - dependencies: - - deploy:jdk8 - artifacts: - paths: - - public + - if [ ! -f ci_settings.xml ]; + then echo CI settings missing, please see https://gitlab.com/help/user/project/packages/maven_repository.md#creating-maven-packages-with-gitlab-cicd for instructions.; + fi + - 'cp ci_settings.xml /root/.m2/settings.xml' + - 'mvn $MAVEN_CLI_OPTS deploy' only: - master + image: maven:3.3.9-jdk-8 -- cgit v1.2.1 From a2aa160cea36fd8969e38eafb352154ee7d8f6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Cunha?= Date: Tue, 9 Apr 2019 20:45:58 +0100 Subject: Adapt functions to work for external Knative Remove Kn services cache from Clusters::Application::Knative Knative function can exist even if user did not installed Knative via GitLab managed apps. -> Move responsibility of finding services into the Cluster -> Responsability is inside Clusters::Cluster::KnativeServiceFinder -> Projects::Serverless::FunctionsFinder now calls depends solely on a cluster to find the Kn services. -> Detect Knative by resource presence instead of service presence -> Mock knative_installed response temporarily for frontend to develop Display loader while `installed === 'checking'` Added frontend work to determine if Knative is installed Memoize with_reactive_cache(*args, &block) to avoid race conditions When calling with_reactive_cache more than once, it's possible that the second call will already have the value populated. Therefore, in cases where we need the sequential calls to have consistent results, we'd fall under a race condition. Check knative installation via Knative resource presence Only load pods if Knative is discovered Always return a response in FunctionsController#index - Always indicate if Knative is installed, not installed or checking - Always indicate the partial response for functions. Final response is guaranteed when knative_installed is either true | false. Adds specs for Clusters::Cluster#knative_services_finder Fix method name when calling on specs Add an explicit check for functions Added an explicit check to see if there are any functions available Fix Serverless feature spec - we don't find knative installation via database anymore, rather via Knative resource Display error message for request timeouts Display an error message if the request times out Adds feature specs for when functions exist Remove a test purposed hardcoded flag Add ability to partially load functions Added the ability to partially load functions on the frontend Add frontend unit tests Added tests for the new frontend additions Generate new translations Generated new frontend translations Address review comments Cleaned up the frontend unit test. Added computed prop for `isInstalled`. Move string to constant Simplify nil to array conversion Put knative_installed states in a frozen hash for better read Pluralize list of Knative states Quey services and pods filtering name This way we don't need to filter the namespace in memory. Also, the data we get from the network is much smaller. Simplify cache_key and fix bug - Simplifies the cache_key by removing namespace duplicate - Fixes a bug with reactive_cache memoization --- .../serverless/components/functions.vue | 36 ++++--- app/assets/javascripts/serverless/constants.js | 4 + .../javascripts/serverless/serverless_bundle.js | 3 +- app/assets/javascripts/serverless/store/actions.js | 29 ++++-- .../javascripts/serverless/store/mutation_types.js | 2 + .../javascripts/serverless/store/mutations.js | 15 ++- app/assets/javascripts/serverless/store/state.js | 1 + .../projects/serverless/functions_controller.rb | 10 +- .../clusters/cluster/knative_services_finder.rb | 114 +++++++++++++++++++++ .../projects/serverless/functions_finder.rb | 39 ++++--- app/models/clusters/applications/knative.rb | 48 --------- app/models/clusters/cluster.rb | 4 + ...rverless-with-existing-knative-installation.yml | 5 + locale/gitlab.pot | 3 + .../serverless/functions_controller_spec.rb | 92 ++++++++++++++--- .../features/projects/serverless/functions_spec.rb | 59 ++++++++--- .../cluster/knative_services_finder_spec.rb | 105 +++++++++++++++++++ .../projects/serverless/functions_finder_spec.rb | 68 +++++++----- .../serverless/components/environment_row_spec.js | 8 +- .../serverless/components/functions_spec.js | 27 ++++- spec/frontend/serverless/mock_data.js | 110 ++++++++++---------- spec/frontend/serverless/store/getters_spec.js | 2 +- spec/frontend/serverless/store/mutations_spec.js | 4 +- spec/models/clusters/applications/knative_spec.rb | 76 -------------- spec/models/clusters/cluster_spec.rb | 5 + spec/support/helpers/kubernetes_helpers.rb | 46 +++++++-- 26 files changed, 617 insertions(+), 298 deletions(-) create mode 100644 app/finders/clusters/cluster/knative_services_finder.rb create mode 100644 changelogs/unreleased/58941-use-gitlab-serverless-with-existing-knative-installation.yml create mode 100644 spec/finders/clusters/cluster/knative_services_finder_spec.rb diff --git a/app/assets/javascripts/serverless/components/functions.vue b/app/assets/javascripts/serverless/components/functions.vue index f9b4e789563..94341050b86 100644 --- a/app/assets/javascripts/serverless/components/functions.vue +++ b/app/assets/javascripts/serverless/components/functions.vue @@ -4,6 +4,7 @@ import { GlLoadingIcon } from '@gitlab/ui'; import FunctionRow from './function_row.vue'; import EnvironmentRow from './environment_row.vue'; import EmptyState from './empty_state.vue'; +import { CHECKING_INSTALLED } from '../constants'; export default { components: { @@ -13,10 +14,6 @@ export default { GlLoadingIcon, }, props: { - installed: { - type: Boolean, - required: true, - }, clustersPath: { type: String, required: true, @@ -31,8 +28,15 @@ export default { }, }, computed: { - ...mapState(['isLoading', 'hasFunctionData']), + ...mapState(['installed', 'isLoading', 'hasFunctionData']), ...mapGetters(['getFunctions']), + + checkingInstalled() { + return this.installed === CHECKING_INSTALLED; + }, + isInstalled() { + return this.installed === true; + }, }, created() { this.fetchFunctions({ @@ -47,15 +51,16 @@ export default {