Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

chore: merge feature rstudio #807

Merged
merged 97 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
560bd72
Rstudio DEV Added ALB provisioing as a step in launch workflow
manikandan-thangavelu-rl May 17, 2021
f63493b
Removed projectId from input payload
manikandan-thangavelu-rl May 17, 2021
7f5f8fd
Removed policy for elb
manikandan-thangavelu-rl May 17, 2021
817e5df
Merge branch 'mainline' into rstudio-dev
manikandan-thangavelu-rl May 17, 2021
4666030
Merge pull request #1 from manikandan-thangavelu-rl/rstudio-dev
manikandan-thangavelu-rl May 17, 2021
41abd7a
Removed unwanted logs
manikandan-thangavelu-rl May 18, 2021
01eaf98
Modified ALB CFT
manikandan-thangavelu-rl May 19, 2021
b1f99ef
Changed var naming convention, added comments to ignore temporary cod…
manikandan-thangavelu-rl May 19, 2021
43073fb
Merge pull request #1 from manikandan-thangavelu-rl/mainline
RLIndia May 19, 2021
9e19d43
Added ALB permisison for SC launch constraint role, and changed ALB s…
manikandan-thangavelu-rl May 20, 2021
3f2aeab
Removed unwanted comments
manikandan-thangavelu-rl May 20, 2021
1e09282
Merge pull request #2 from manikandan-thangavelu-rl/rstudio-terminate
RLIndia May 20, 2021
bd96ce6
feat: terminate lauch dependencies before terminating peroduct
manikandan-thangavelu-rl May 25, 2021
a2c3c94
Removed unwanted logs
manikandan-thangavelu-rl May 25, 2021
70e7786
Merge pull request #3 from manikandan-thangavelu-rl/rstudio-terminate
RLIndia May 27, 2021
8a9f681
Merge pull request #4 from RLOpenCatalyst/develop
RLIndia May 28, 2021
76f2307
fix: incorporated PR comments on code style
manikandan-thangavelu-rl May 29, 2021
f7f706d
Merge pull request #6 from manikandan-thangavelu-rl/feat-rstudio-alb
RLIndia May 29, 2021
1843841
Modified pnpm lock to fix PR issue
manikandan-thangavelu-rl May 31, 2021
74de03c
fix static code analysis and linting issues
manikandan-thangavelu-rl May 31, 2021
6ead1b7
Merge pull request #9 from manikandan-thangavelu-rl/feat-rstudio-alb
RLIndia Jun 1, 2021
1029644
Added unit test cases for alb-service
manikandan-thangavelu-rl Jun 2, 2021
cfc33d9
Merge pull request #10 from manikandan-thangavelu-rl/feat-rstudio-alb
RLIndia Jun 2, 2021
e952bee
Fetching availability zones dynamically in alb cft
manikandan-thangavelu-rl Jun 2, 2021
6e31c94
Merge pull request #11 from manikandan-thangavelu-rl/feat-rstudio-alb
RLIndia Jun 2, 2021
c370f16
Fix: Incorporated PR comments
manikandan-thangavelu-rl Jun 8, 2021
509455d
Merge pull request #15 from manikandan-thangavelu-rl/feat-rstudio-alb
RLIndia Jun 8, 2021
f7c34b4
chore: dependabot suggested package versions (#488)
SanketD92 May 13, 2021
cba14ca
docs: Update docs to specify Packer version 1.6.0 (#484)
nguyen102 May 13, 2021
2a1021f
fix: adds 'stopped' filter for workspaces
ahl27 May 12, 2021
c08a146
bulkUserAdd API bugfix (#490)
ahl27 May 14, 2021
0ea7db2
fix: moved notification boxes to avoid blocking the top ribbon. (#483)
ahl27 May 14, 2021
f24bae4
chore: Update UI to show 3.1 (#493)
rsmayda May 17, 2021
3627100
chore: Update issue templates (#487)
SanketD92 May 17, 2021
5516317
fix: Redirect non admin users to "/" if they try to access "/users" (…
nguyen102 May 17, 2021
fc29e3e
chore: update PR checklist (#494)
SanketD92 May 18, 2021
2eb30a9
chore: Add GH action to check for dependency vulnerabilities (#498)
nguyen102 May 20, 2021
86f17a5
fix: react compilation error (#500)
nguyen102 May 20, 2021
979305e
docs: hyperlink corrections (#497)
shyogesh-sw May 20, 2021
e960800
feat: study permissions only shown to Study Admin (#501)
nguyen102 May 21, 2021
c8a455b
fix: add termination status for non-found workspaces (#502)
rsmayda May 25, 2021
9ca6a24
fix: Do not allow users to change root password (#503)
nguyen102 May 26, 2021
be9a2bb
chore: docs dependency fix (#505)
Bingjiling May 27, 2021
ca84b5a
chore(deps): bump dns-packet from 1.3.1 to 1.3.4 in /docs (#507)
dependabot[bot] May 27, 2021
5dc78a7
feat: Add warning that internal authentication shouldn't be used in p…
nguyen102 Jun 2, 2021
53c788d
feat: Encrypt s3 buckets for EMR log bucket and CICD Artifact bucket …
nguyen102 Jun 3, 2021
f69225f
chore: Disable EBS volume for storage gateway (#511)
nguyen102 Jun 3, 2021
f23a877
chore: Add encryption to CICD SNS topic (#512)
nguyen102 Jun 7, 2021
1e9c4b2
fix: Allow sagemaker to have the proper IAM permission to autostop it…
nguyen102 Jun 7, 2021
de2c2ff
chore: Enable access logging for env-type-configs bucket (#520)
jn1119 Jun 9, 2021
afb671d
chore: Enable server side encryption on prepare master and edge lambd…
jn1119 Jun 9, 2021
acf3280
fix: Corrected Spark defaults to fix read/write functionality from Sp…
jn1119 Jun 10, 2021
f8083db
chore(release): 3.2.0 (#531)
jn1119 Jun 11, 2021
fd6dfcd
chore(deps): bump glob-parent from 5.1.1 to 5.1.2 in /scripts/load-te…
dependabot[bot] Jun 14, 2021
ec4e3b2
feat: Add warning that internal authentication shouldn't be used in p…
nguyen102 Jun 2, 2021
d276d1c
feat: Encrypt s3 buckets for EMR log bucket and CICD Artifact bucket …
nguyen102 Jun 3, 2021
efa99cb
chore: Disable EBS volume for storage gateway (#511)
nguyen102 Jun 3, 2021
15957b8
chore: Add encryption to CICD SNS topic (#512)
nguyen102 Jun 7, 2021
6d6e0ed
fix: Allow sagemaker to have the proper IAM permission to autostop it…
nguyen102 Jun 7, 2021
b4aa7e6
chore: Enable access logging for env-type-configs bucket (#520)
jn1119 Jun 9, 2021
5e2701c
chore: Enable server side encryption on prepare master and edge lambd…
jn1119 Jun 9, 2021
ad5c1da
fix: Corrected Spark defaults to fix read/write functionality from Sp…
jn1119 Jun 10, 2021
ebd3f75
chore(release): 3.2.0 (#531)
jn1119 Jun 11, 2021
30976d5
chore(deps): bump glob-parent from 5.1.1 to 5.1.2 in /scripts/load-te…
dependabot[bot] Jun 14, 2021
5a443b2
Merge branch 'feat-rstudio-alb' into feat-rstudio-alb
manikandan-thangavelu-rl Jun 14, 2021
68ec6dd
Merge pull request #499 from RLOpenCatalyst/feat-rstudio-alb
jn1119 Jun 15, 2021
2aca6f3
feat: added distributed locks for ALB (#518)
manikandan-thangavelu-rl Jun 23, 2021
64eb213
feat: Added IAM permissions required for ALB (#519)
manikandan-thangavelu-rl Jun 23, 2021
9a4da3a
chore: unit test cases for check and launch dependency (#524)
manikandan-thangavelu-rl Jun 30, 2021
cd49cb9
feat: edit CIDR for RstudioV2 (#536)
manikandan-thangavelu-rl Jun 30, 2021
d1c230b
feat: added Subnet2 in account onboarding (#552)
manikandan-thangavelu-rl Jul 6, 2021
51bc8a7
feat: Added product metadata and portfolio ID in the UI (#543)
manikandan-thangavelu-rl Jul 7, 2021
4ac0ddd
feat: Allowing traffic only through ALB for Rstudio (#564)
manikandan-thangavelu-rl Jul 7, 2021
33fa525
feat: Added permission to create service-role (#568)
manikandan-thangavelu-rl Jul 13, 2021
50405be
Chore: Update latest develop code with feat-rstudio-alb (#627)
manikandan-thangavelu-rl Sep 29, 2021
9c31bfc
Merge mainline into RStudio-ALB feature (#729)
SanketD92 Oct 4, 2021
9f35b6b
fix: openAPI doc (#732)
SanketD92 Oct 5, 2021
c721a59
fix: count logic alb workspaces (#764)
SanketD92 Oct 21, 2021
a34c414
chore: merge develop to rstudio (#776)
SanketD92 Oct 28, 2021
a1fe5d1
fix: better error message
SanketD92 Oct 28, 2021
f5af682
fix: bootstrap changes
SanketD92 Oct 28, 2021
706f82d
fix: replace get with post rstudio connect (#796)
SanketD92 Nov 11, 2021
3ef20d4
fix: Don't delete ALB if another instance is starting (#797)
nguyen102 Nov 12, 2021
db8fccc
feat: integrating appstream with rstudio-alb (#783)
SanketD92 Nov 15, 2021
c93f0da
Merge feature into develop
SanketD92 Nov 15, 2021
216a991
fix: lock file updates
SanketD92 Nov 15, 2021
8a3ca80
Rstudiodocs2 (#808)
shyogesh-sw Nov 15, 2021
6d7c89a
lock file update
SanketD92 Nov 16, 2021
b702cf8
chore: deprecate legacy rstudio (#805)
SanketD92 Nov 16, 2021
719de9a
Merge from feature
SanketD92 Nov 16, 2021
64b4ccd
fix: set condition for public route table
SanketD92 Nov 16, 2021
e5415cd
fix: set condition for public route table (#810)
SanketD92 Nov 16, 2021
c3c48c0
Merge branch 'feat-rstudio-alb' of github.com:awslabs/service-workben…
SanketD92 Nov 16, 2021
64a1473
fix: send unencoded url for RStudio POST
SanketD92 Nov 18, 2021
6a01fd5
chore: Update workspace config for TRE env (#815)
nguyen102 Nov 18, 2021
04c61a5
test: rstudio alb integration tests (#813)
nguyen102 Nov 18, 2021
ab6c1f3
fix: hide RStudio UI form component
SanketD92 Nov 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Pre-requisites: Before creating a workspace, you must setup Service Catalog. Ref
4. Your workspace may take some time to launch. Once it is up and running, you can connect to it by choosing Connect. For more details, see the following documentation pages:
+ AWS SageMaker: Service Workbench takes care of provisioning the workspace for you, so you can jump straight to working with SageMaker Notebooks. For more information, see the [SageMaker Getting Started Guide](https://docs.aws.amazon.com/sagemaker/latest/dg/gs-console.html) (you can jump straight to Step 4).
+ AWS ElasticMapReduce (EMR): Service Workbench takes care of setting up the EMR instance for you, so you can jump straight to working with EMR Notebooks. For more information on using EMR Notebooks, see [Using EMR Notebooks](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-notebooks.html). **Note:** A password may be required to access the EMR Notebooks. By default, this password is 'go-research-on-aws' (without the quotes).
+ RStudio: See the [RStudio Server Documentation](https://support.rstudio.com/hc/en-us/sections/200150693-RStudio-Server) for assistance.
+ RStudio: You can connect to RStudio workspace type by using the template and AMI provided in AWS partner's [repository](https://github.com/RLOpenCatalyst/Service_Workbench_Templates). For more information, refer to the [Create RStudio ALB workspace](/deployment/post_deployment/aws_accounts#creating-rstudio-alb-workspace) section of *Service Workbench Post Deployment Guide*.
+ AWS Elastic Compute Cloud (EC2): EC2 instances are essentially Virtual Machines in the cloud. For more information, see the [EC2 Documentation](https://aws.amazon.com/ec2/).

## Create a Study
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const Service = require('@aws-ee/base-services-container/lib/service');
const { runAndCatch } = require('@aws-ee/base-services/lib/helpers/utils');

const createOrUpdateSchema = require('./schema/deployment-item');
const createOrUpdateSchema = require('./schema/deployment-item.json');

const settingKeys = {
tableName: 'dbDeploymentStore',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const UserService = require('@aws-ee/base-services/lib/user/user-service');
const DbPasswordService = require('@aws-ee/base-services/lib/db-password/db-password-service');
const AuthenticationProviderTypeService = require('@aws-ee/base-api-services/lib/authentication-providers/authentication-provider-type-service');
const AuthenticationProviderConfigService = require('@aws-ee/base-api-services/lib/authentication-providers/authentication-provider-config-service');
const registerBuiltInAuthProvisioners = require('@aws-ee/base-api-services/lib/authentication-providers/register-built-in-provisioner-services.js');
const registerBuiltInAuthProvisioners = require('@aws-ee/base-api-services/lib/authentication-providers/register-built-in-provisioner-services');

const DeploymentStoreService = require('../deployment-store-service');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const Service = require('@aws-ee/base-services-container/lib/service');
const { runAndCatch } = require('@aws-ee/base-services/lib/helpers/utils');

const createOrUpdateSchema = require('./schema/deployment-item');
const createOrUpdateSchema = require('./schema/deployment-item.json');

const settingKeys = {
tableName: 'dbDeploymentStore',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const UserService = require('@aws-ee/base-services/lib/user/user-service');
const DbPasswordService = require('@aws-ee/base-services/lib/db-password/db-password-service');
const AuthenticationProviderTypeService = require('@aws-ee/base-api-services/lib/authentication-providers/authentication-provider-type-service');
const AuthenticationProviderConfigService = require('@aws-ee/base-api-services/lib/authentication-providers/authentication-provider-config-service');
const registerBuiltInAuthProvisioners = require('@aws-ee/base-api-services/lib/authentication-providers/register-built-in-provisioner-services.js');
const registerBuiltInAuthProvisioners = require('@aws-ee/base-api-services/lib/authentication-providers/register-built-in-provisioner-services');

const DeploymentStoreService = require('../deployment-store-service');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import React from 'react';
import { decorate, computed } from 'mobx';
import { observer, inject } from 'mobx-react';
import { withRouter } from 'react-router-dom';
import { Header, Label, Popup, Icon, Divider, Message, Table, Grid, Segment } from 'semantic-ui-react';
import { Header, Label, Popup, Icon, Divider, Message, Table, Grid, Segment, List } from 'semantic-ui-react';
import TimeAgo from 'react-timeago';
import { niceNumber, swallowError } from '@aws-ee/base-ui/dist/helpers/utils';
import { isStoreLoading, isStoreNotEmpty, isStoreError } from '@aws-ee/base-ui/dist/models/BaseStore';
Expand Down Expand Up @@ -92,6 +92,7 @@ class ScEnvironmentCard extends React.Component {
{this.renderTitle(env)}
{this.renderError(env)}
{this.renderWarning(env)}
{this.renderLegacyRStudioWarning(env)}
<Divider className="mt1 mb1" />
{this.renderButtons(env)}
<Divider className="mt1" />
Expand Down Expand Up @@ -176,6 +177,35 @@ class ScEnvironmentCard extends React.Component {
);
}

renderLegacyRStudioWarning(env) {
const metaConnection1Type = env.outputs.find(obj => obj.OutputKey === 'MetaConnection1Type');
if (metaConnection1Type && metaConnection1Type.OutputValue.toLowerCase() === 'rstudio' && env.state.canTerminate) {
return (
<>
<Message
icon="warning"
header="Legacy RStudio environment found"
content="Please terminate this workspace as soon as possible. Support for this environment type has been deprecated. Please use RStudioV2 instead."
/>
<div className="mt3">
For more information, refer to the Create RStudio ALB workspace section of our Post Deployment Guide:
</div>
<List bulleted>
<List.Item
href="https://github.com/awslabs/service-workbench-on-aws/blob/mainline/docs/Service_Workbench_Post_Deployment_Guide.pdf"
target="_blank"
rel="noopener noreferrer"
>
Post Deployment Guide
</List.Item>
</List>
</>
);
}

return null;
}

renderWarning(env) {
if (isAppStreamEnabled && !env.isAppStreamConfigured && env.state.canTerminate) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,28 @@ class ScEnvironmentHttpConnections extends React.Component {
url = urlObj.url;

if (url) {
const newTab = openWindow('about:blank');
newTab.location = url;
if (connectInfo.type.toLowerCase() === 'rstudiov2') {
const rstudioUrl = url.split('?v=')[0];
const token = url.split('auth-do-sign-in?')[1];
const tokenKey = 'v';
const tokenVal = token.split('v=')[1];
const mapForm = document.createElement('form');
mapForm.target = 'Map';
mapForm.method = 'POST';
mapForm.action = rstudioUrl;
mapForm.style.display = 'none';

const mapInput = document.createElement('input');
mapInput.name = tokenKey;
mapInput.value = decodeURIComponent(tokenVal);
mapForm.appendChild(mapInput);

document.body.appendChild(mapForm);
mapForm.submit();
} else {
const newTab = openWindow('about:blank');
newTab.location = url;
}
}
}
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class ScEnvironmentUpdateCidrs extends React.Component {
return this.stores.ready;
}, sideEffect);
sideEffect(this.stores.ready);
this.validateMaxCidrs = false;
}

componentDidMount() {
Expand Down Expand Up @@ -184,6 +185,19 @@ class ScEnvironmentUpdateCidrs extends React.Component {
return invalidCidrFound;
};

const validateMaxRStudioCidr = () => {
let status = false;
const envOutputs = this.environment.outputs;
const metaConnection1Type = envOutputs.find(obj => obj.OutputKey === 'MetaConnection1Type');
if (metaConnection1Type) {
const productName = metaConnection1Type.OutputValue;
if (productName === 'RStudioV2') {
status = this.validateMaxCidrs;
}
}
return status;
};

return (
<Segment clearing className="p3 mb3">
{fields.value.length === 0 && (
Expand Down Expand Up @@ -217,13 +231,22 @@ class ScEnvironmentUpdateCidrs extends React.Component {
content="One or more options entered are not valid IPv4 CIDR blocks. Please enter CIDR blocks in the format: '255.255.255.255/32'"
/>
)}
{validateMaxRStudioCidr() && (
<Message
negative
className="mb4"
icon="warning"
header="Maximum limit CIDR reached"
content="You can set maximum number of 4 IPv4 CIDR in this blocks"
/>
)}
<Button
className="ml2"
size="mini"
floated="right"
color="blue"
icon
disabled={processing || anyInvalidCidr()}
disabled={processing || anyInvalidCidr() || validateMaxRStudioCidr()}
type="submit"
>
Submit
Expand Down Expand Up @@ -260,6 +283,24 @@ class ScEnvironmentUpdateCidrs extends React.Component {
return _.some(this.ingressRules[index].cidrBlocks, cidr => IsCidr(cidr) !== 4);
};

const validateMaxRStudioCidr = () => {
this.validateMaxCidrs = false;
const eEnvOutputs = this.environment.outputs;
const metaConnection1Type = eEnvOutputs.find(obj => obj.OutputKey === 'MetaConnection1Type');
if (metaConnection1Type) {
const productName = metaConnection1Type.OutputValue;
const fromPort = field.value.fromPort;
if (productName === 'RStudioV2' && fromPort === 443) {
const cidrBlocks = field.value.cidrBlocks;
const cidrLen = cidrBlocks.length;
if (cidrLen > 4) {
this.validateMaxCidrs = true;
}
}
}
return this.validateMaxCidrs;
};

// If you're using this component for reference:
// The dropdown cell in this table is using the semantic-ui-react properties to display warnings and errors
// These validation mechanisms have already been implemented in the built-in Form component which are better suited for such scenarios
Expand All @@ -275,7 +316,7 @@ class ScEnvironmentUpdateCidrs extends React.Component {
<Table.Cell>
<Input disabled field={field.$('toPort')} />
</Table.Cell>
<Table.Cell warning={anyWideCidr()} error={anyInvalidCidr()}>
<Table.Cell warning={anyWideCidr()} error={(anyInvalidCidr(), validateMaxRStudioCidr())}>
<Dropdown
field={field.$('cidrBlocks')}
allowAdditions
Expand Down Expand Up @@ -307,7 +348,6 @@ decorate(ScEnvironmentUpdateCidrs, {
environment: computed,
envsStore: computed,
clientInformationStore: computed,

ingressRules: observable,
form: observable,
handleSave: action,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import ec2WindowsInstance from '../templates/ec2-windows-instance.cfn.yml';
import sagemakerInstance from '../templates/sagemaker-notebook-instance.cfn.yml';
import onboardAccount from '../templates/onboard-account.cfn.yml';
import storageGatewayNetworkInfra from '../templates/storage-gateway/network-infrastructure.cfn.yml';
import applicationLoadBalancer from '../templates/application-load-balancer.cfn.yml';

const add = (name, yaml) => ({ name, yaml });

Expand All @@ -32,6 +33,7 @@ const templates = [
add('sagemaker-notebook-instance', sagemakerInstance),
add('onboard-account', onboardAccount),
add('storage-gateway-network-infra', storageGatewayNetworkInfra),
add('application-load-balancer', applicationLoadBalancer),
];

async function registerCfnTemplates(registry) {
Expand Down
Loading