Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/v2-master' into token-linking
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Sep 4, 2018
2 parents 400bbce + 0612282 commit 06d0143
Show file tree
Hide file tree
Showing 94 changed files with 1,681 additions and 353 deletions.
40 changes: 18 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ services:
- docker
addons:
chrome: stable
artifacts:
paths:
- ./e2e-reports
target_paths:
- e2e
debug: true
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand All @@ -33,42 +27,44 @@ cache:
- "$HOME/.cache"
- node_modules
stages:
- Frontend Lint
- Frontend Unit Tests
- Backend
- name: E2E tests
if: type != pull_request OR commit_message =~ /\[e2e\-full\]/
- name: E2E tests quick
if: type != pull_request OR head_branch =~ ^(?i:e2e)-.*$ OR commit_message =~ /\[e2e\]/
- Lint
- Test
jobs:
include:
- stage: Frontend Lint
- stage: Lint
name: Frontend Lint
script:
- npm run lint
- stage: Frontend Unit Tests
- name: Backend Lint
before_script:
- curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
- chmod +x ~/bin/gimme
- eval "$(gimme 1.9)"
- go get -u golang.org/x/lint/golint
script:
- golint src/jetstream/...
- ./deploy/ci/travis/update-go-report-card.sh
- stage: Test
name: Frontend Unit Tests
env:
- CI_ENV=true
script:
- npm test
- npm run codecov
- stage: Backend
- name: Backend Unit Tests
before_script:
- curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
- chmod +x ~/bin/gimme
- eval "$(gimme 1.9)"
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
script:
- npm run test-backend
- stage: E2E tests
before_script:
- chmod +x ./deploy/ci/travis/run-e2e-tests.sh
script:
- "./deploy/ci/travis/run-e2e-tests.sh"
- stage: E2E tests quick
- name: E2E Tests
before_script:
- chmod +x ./deploy/ci/travis/run-e2e-tests.sh
script:
- "./deploy/ci/travis/run-e2e-tests.sh quick"
- "./deploy/ci/travis/upload-e2e-test-report.sh"
notifications:
slack:
secure: s5SFnFKwzfxLrjGR5lJ2AJG1FSWCKtHdQi8K2Kmx5ZhrYL/7P+KLc/ks18WnzCPoy705LbHCBSULcnWbLjqCpnkKxNjsFAyFl2nZZPxBjl2/mHpulbr3gmultDOrMDbmYL4oWPKBlxKResElz9nQwknlLWZ/L94AIx8zuMfRIWdEt1bJBDAQts4fx2D4cIEx0yZUq7JGAKjSiXKR9eDyMWFb+SWw6mvr5WtFM8uq35rPvRVEfm56LIgSuMUpVeYtnYiY2JP7W8iKX0gD+54wAiSXRZiQVCLJq606/TlJo7j8Na9Dn1Q5XDkX3b3XzcgmEZThoO1GFtv3yNYOVxv+50p2tSnc8CT0VEVOYOGJuz17AESZAYK+AyjEmeZmDiroj1czmIq8/ZYKbmvDYSZgGuDcSkQurX/6BPac6ra69WmSQmwv0tS3A/IzDw7X+CuC+3QubQ7GfaiVe25PUU+tRSEDM4PMUJY8QRF5Q+oeN5NjjWmJBqf/ic2TO2xTU1j+qysdqK34qIV1qyVcPMUIiYW+5ltH71qiy05TSvvfGS+oatRBMzINRl3zl2gOV1CKNU801XehRKCx9XDCw5NL1HSx5HD5psOyBRpAMYYBOqa+rv9VAza9MsfpslCoibg5rdrq4rZqqUgRhayNp/LKzlhe/g62+qbGNT+iFuHtB+Y=
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Stratos

<a href="https://travis-ci.org/cloudfoundry-incubator/stratos/branches"><img src="https://travis-ci.org/cloudfoundry-incubator/stratos.svg?branch=v2-master"></a>&nbsp;<a style="padding-left: 4px" href="https://codeclimate.com/github/cloudfoundry-incubator/stratos/maintainability"><img src="https://api.codeclimate.com/v1/badges/61af8b605f385e894632/maintainability" /></a>
<a href="https://codecov.io/gh/cloudfoundry-incubator/stratos">
<img src="https://codecov.io/gh/cloudfoundry-incubator/stratos/branch/master/graph/badge.svg"/></a>
<a href="https://goreportcard.com/github.com/cloudfoundry-incubator/stratos"><img src="https://goreportcard.com/badge/github.com/cloudfoundry-incubator/stratos"/></a>
<a href="https://codecov.io/gh/cloudfoundry-incubator/stratos/branch/v2-master"><img src="https://codecov.io/gh/cloudfoundry-incubator/stratos/branch/v2-master/graph/badge.svg"/></a>
<a href="https://app.zenhub.com/workspace/o/cloudfoundry-incubator/stratos/boards"><img src="https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png"/></a>
[![GitHub release](https://img.shields.io/github/release/cloudfoundry-incubator/stratos.svg)](https://github.com/cloudfoundry-incubator/stratos/releases/latest)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/cloudfoundry-incubator/stratos/blob/master/LICENSE)
[![slack.cloudfoundry.org](https://slack.cloudfoundry.org/badge.svg)](https://cloudfoundry.slack.com/messages/C80EP4Y57/)


Stratos is an Open Source Web-based UI (Console) for managing Cloud Foundry. It allows users and administrators to both manage applications running in the Cloud Foundry cluster and perform cluster management tasks.

If you are looking for the V1 version of Stratos, you can find it in the [master](https://github.com/cloudfoundry-incubator/stratos/tree/master) branch.
Expand Down Expand Up @@ -69,3 +70,4 @@ You can join the Cloud Foundry Slack here - https://slack.cloudfoundry.org/ - a
## License

The work done has been licensed under Apache License 2.0. The license file can be found [here](LICENSE).

10 changes: 10 additions & 0 deletions deploy/ci/tasks/dev-releases/create-chart-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ setupAndPushChange() {

}

updateHelmDependency() {
START_CWD=$(pwd)
cd ${STRATOS}/deploy/kubernetes/console
# Extract helm repo
HELM_REPO=$(cat requirements.yaml | grep repo | sed -e 's/.*repository:\s\(.*\)/\1/p' | head -1)
helm repo add repo ${HELM_REPO}
helm dependency update
cd ${START_CWD}
}

fetchImageTag() {
echo "$(cat ${STRATOS}/deploy/ci/tasks/dev-releases/nightly-tag)-$(git rev-parse HEAD | head -c 8)"
}
Expand Down
1 change: 1 addition & 0 deletions deploy/ci/tasks/dev-releases/create-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ run:
cd ${STRATOS}/deploy/kubernetes/
patchHelmChart ${GIT_TAG} ${DOCKER_ORG} ${DOCKER_REGISTRY} ./console
# Generate Helm package
updateHelmDependency
helm package console
cp console*.tgz ${ROOT_DIR}/helm-chart/console-helm-chart-${GIT_TAG}.tgz
cd ${ROOT_DIR}/helm-chart/
Expand Down
1 change: 1 addition & 0 deletions deploy/ci/tasks/dev-releases/create-nightly-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ run:
patchHelmChartDev ${IMAGE_TAG} ${DOCKER_ORG} ${DOCKER_REGISTRY} ./console
# Generate Helm package
updateHelmDependency
helm package console
cp console*.tgz ${ROOT_DIR}/helm-chart/console-helm-chart-v${IMAGE_TAG}.tgz
cd ${ROOT_DIR}/helm-chart/
Expand Down
Empty file modified deploy/ci/travis/create-pr-branch.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion deploy/ci/travis/run-e2e-tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fi
# Output backend log if the tests failed
if [ "${RUN_TYPE}" == "quick" ]; then
if [ $RESULT -ne 0 ]; then
cat outputs/backend.log
cat src/jetstream/backend.log
fi
fi

Expand Down
11 changes: 11 additions & 0 deletions deploy/ci/travis/update-go-report-card.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Only update if this is running against v2-master
if [ "$TRAVIS_BRANCH" == "v2-master" ] && [ "$TRAVIS_EVENT_TYPE" != "pull_request" ]; then
echo "Updating GO Report Card for: github.com/${TRAVIS_REPO_SLUG}"
curl -m 300 -d "repo=github.com/${TRAVIS_REPO_SLUG}" https://goreportcard.com/checks
fi

# Always return success - any failure is down to the goreportcad site not being available
# Don't fail our build for this reason
exit 0
24 changes: 24 additions & 0 deletions deploy/ci/travis/upload-e2e-test-report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

echo "Stratos e2e test report upload"
echo "=============================="

if [ -z "${AWS_ENDPOINT}" ]; then
echo "Need S3 endpoint URL"
exit 1
fi

wget https://dl.minio.io/client/mc/release/linux-amd64/mc
chmod +x mc

echo "Uploading test report...."

echo "Configuring upload client"
./mc config host add s3 ${AWS_ENDPOINT} ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY} --insecure

echo "Uploading ..."
# Sync the E2E reports
./mc cp --insecure -r e2e-reports s3/${S3_BUCKET}

# Test report upload failure will not fail the Travis job
exit 0
29 changes: 29 additions & 0 deletions deploy/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,32 @@ Install
```
helm install stratos/console --namespace=console --name my-console --version 2.0.0-dev-9a5611dc
```

### Enabled Metrics

[Stratos Metrics](https://github.com/suse/stratos-metrics) can be deployed as part of the Stratos helm chart. The following override file will configure the Metrics component to fetch metrics from a PCF Dev instance.

Save the following to a file called `values.yaml`
```
consoleVersion: 2.0.0
metrics:
enabled: true
env:
CLUSTER_ADMIN_PASSWORD: admin
UAA_CF_IDENTITY_ZONE: uaa
DOMAIN: local.pcfdev.io
UAA_ADMIN_CLIENT_SECRET: admin-client-secret
UAA_HOST: uaa.local.pcfdev.io
UAA_PORT: 443
DOPPLER_PORT: 443
firehoseExporter:
noIdentityZone: true
```

Deploy Stratos with Metrics enabled
```
$ helm install ./console -f values.yaml --name console --namespace stratos
```

The metrics endpoint will be available as `https://console-metrics-nginx`. This can registered as an endpoint in Stratos as a `Metrics` type.
3 changes: 3 additions & 0 deletions deploy/kubernetes/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ buildPostflightJob
buildMariaDb
buildUI

# Fetch subcharts
helm dependency update

if [ ${CONCOURSE_BUILD:-"not-set"} == "not-set" ]; then
# Patch Values.yaml file
cp values.yaml.tmpl values.yaml
Expand Down
6 changes: 6 additions & 0 deletions deploy/kubernetes/console/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: metrics
repository: https://cloudfoundry-incubator.github.io/stratos
version: 2.0.0-metrics-dev
digest: sha256:82dc83e153f6c8115db7c2e0030c9d378bbeaa08bdddad97cf23a559aa9a12c8
generated: 2018-08-02T11:02:52.066583002+01:00
5 changes: 5 additions & 0 deletions deploy/kubernetes/console/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies:
- name: metrics
version: 2.0.0-metrics-dev
repository: https://cloudfoundry-incubator.github.io/stratos
condition: metrics.enabled
4 changes: 4 additions & 0 deletions deploy/kubernetes/console/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ spec:
value: "{{ .Chart.Version }}"
- name: HELM_LAST_MODIFIED
value: "{{ .Release.Time }}"
- name: SSO_LOGIN
value: {{default "false" .Values.console.ssoLogin | quote}}
- name: SSO_OPTIONS
value: {{default "" .Values.console.ssoOptions | quote}}
ports:
- containerPort: 3003
name: proxy
Expand Down
6 changes: 5 additions & 1 deletion deploy/kubernetes/console/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ console:
cookieDomain:
# externalIP: 127.0.0.1
backendLogLevel: info
ssoLogin: false
ssoOptions:
images:
console: stratos-console
proxy: stratos-jetstream
Expand Down Expand Up @@ -78,4 +80,6 @@ kube:
password:
email: default
services:
loadbalanced: false
loadbalanced: false
metrics:
enabled: false
20 changes: 20 additions & 0 deletions docs/status_updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

Weekly status updates are published here.


## 31st August 2018

Update for this week:

- Go-backend re-structure - The additional cleanup work has been merged.

- Single-Sign-On - Further work on Single-Sign On:
- Improvements - improve error handling, add navigate straight to login option [#2522](https://github.com/cloudfoundry-incubator/stratos/pull/2522)
- Link tokens rather than copying them [#2916](https://github.com/cloudfoundry-incubator/stratos/pull/2916)
- Allow a Cloud Foundry endpoint to be connected with SSO login [#2928](https://github.com/cloudfoundry-incubator/stratos/pull/2928)

- Allow Client ID and Secret to be set when registering an endpoint [#2920](https://github.com/cloudfoundry-incubator/stratos/pull/2920)

- Scalability:
- Change application list in service instance table row from vertical to chip list [#2915](https://github.com/cloudfoundry-incubator/stratos/pull/2915)
- Convert space apps list from local to remote [#2913](https://github.com/cloudfoundry-incubator/stratos/pull/2913)

- Metrics - Work has started on tidying up and improving the metrics views

## 24th August 2018

Update for this week:
Expand Down
7 changes: 5 additions & 2 deletions protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ try {
process.exit(1);
}

// This is the maximum amount of time ALL before/after/it's must execute in
const timeout = 40000

exports.config = {
allScriptsTimeout: 30000,
allScriptsTimeout: timeout,
specs: [
'./src/test-e2e/**/*-e2e.spec.ts',
],
Expand All @@ -53,7 +56,7 @@ exports.config = {
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
defaultTimeoutInterval: timeout,
print: function () {}
},
params: secrets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Selected Users:
<app-enumerate [collection]="usersNames$"></app-enumerate>
</div>
<div class="modify-users__users-warning" *ngIf="usersWithWarning$ | async"><i>* Not all roles are known for user.</i></div>
<div class="modify-users__users-warning" *ngIf="(usersWithWarning$ | async).length"><i>* Not all roles are known for user.</i></div>
<div class="modify-users__org-roles">
<app-table [dataSource]="orgDataSource" [columns]="orgColumns"></app-table>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export class UsersRolesModifyComponent implements OnInit, OnDestroy {
}

const users$: Observable<CfUserWithWarning[]> = this.store.select(selectUsersRolesPicked).pipe(
filter(users => !!users),
distinctUntilChanged(),
map(users => users.map(this.mapUser.bind(this)))
);
Expand All @@ -190,9 +191,10 @@ export class UsersRolesModifyComponent implements OnInit, OnDestroy {

private mapUser(user: CfUser): CfUserWithWarning {
// If we're at the org level or lower we guarantee org roles. If we're at the space we guarantee space roles.
const showWarning = user.missingRoles &&
(user.missingRoles.org.length && !this.activeRouteCfOrgSpace.orgGuid) ||
(user.missingRoles.space.length && !this.activeRouteCfOrgSpace.spaceGuid);

const showWarning = !!user.missingRoles &&
((user.missingRoles.org.length && !this.activeRouteCfOrgSpace.orgGuid) ||
(user.missingRoles.space.length && !this.activeRouteCfOrgSpace.spaceGuid));
// Ensure we're in an object where the username is always populated (in some cases it's missing)
const newUser = {
...user,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import {filter, map, buffer, debounceTime} from 'rxjs/operators';
import { filter, map, buffer, debounceTime } from 'rxjs/operators';
import { Component, Inject, InjectionToken, Input, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { BehaviorSubject , Observable } from 'rxjs';
import { BehaviorSubject, Observable } from 'rxjs';
import { Customizations, CustomizationsMetadata } from '../../../core/customizations.types';
import { ActionHistoryDump } from '../../../store/actions/action-history.actions';
import { AppState } from '../../../store/app-state';
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/app/features/endpoints/endpoint-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export function getFullEndpointApiUrl(endpoint: EndpointModel) {
return endpoint && endpoint.api_endpoint ? `${endpoint.api_endpoint.Scheme}://${endpoint.api_endpoint.Host}` : 'Unknown';
}

export function getEndpointUsername(endpoint: EndpointModel) {
return endpoint && endpoint.user ? endpoint.user.name : '-';
}

export const DEFAULT_ENDPOINT_TYPE = 'cf';

export interface EndpointTypeHelper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Store } from '@ngrx/store';
import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, of as observableOf } from 'rxjs';
import { combineLatest, filter, first, map, publishReplay, refCount, switchMap, tap } from 'rxjs/operators';
import { combineLatest, filter, first, map, publishReplay, refCount, switchMap } from 'rxjs/operators';

import {
IService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Observable } from 'rxjs';
import { filter, map, publishReplay, refCount } from 'rxjs/operators';

import { IService } from '../../../core/cf-api-svc.types';
import { EntityServiceFactory } from '../../../core/entity-service-factory.service';
import { PaginationMonitorFactory } from '../../../shared/monitors/pagination-monitor.factory';
import { GetAllServices } from '../../../store/actions/service.actions';
import { GetServicesForSpace } from '../../../store/actions/space.actions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { getIdFromRoute } from '../../../../features/cloud-foundry/cf.helpers';
import { servicesServiceFactoryProvider } from '../../../../features/service-catalog/service-catalog.helpers';
import { GetApplication } from '../../../../store/actions/application.actions';
import {
ResetCreateServiceInstanceOrgAndSpaceState,
ResetCreateServiceInstanceState,
SetCreateServiceInstance,
SetCreateServiceInstanceCFDetails,
SetCreateServiceInstanceServiceGuid,
SetServiceInstanceGuid,
ResetCreateServiceInstanceOrgAndSpaceState,
SetCreateServiceInstanceServicePlan,
SetServiceInstanceGuid,
} from '../../../../store/actions/create-service-instance.actions';
import { GetServiceInstance } from '../../../../store/actions/service-instances.actions';
import { GetAllAppsInSpace, GetSpace } from '../../../../store/actions/space.actions';
Expand Down
Loading

0 comments on commit 06d0143

Please sign in to comment.