Skip to content

Commit

Permalink
Merge pull request awslabs#4 from awslabs/master
Browse files Browse the repository at this point in the history
update master
  • Loading branch information
avillach authored Dec 14, 2020
2 parents 693727e + 2ad6460 commit 02f8ae7
Show file tree
Hide file tree
Showing 84 changed files with 10,684 additions and 1,520 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/deploy-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
name: Deploy to Dev
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- uses: actions/setup-go@v2
with:
go-version: 1.13
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: ./scripts/install.sh
- name: Build all packages
run: ./scripts/build-all-packages.sh
- name: Deploy
env:
STAGE_NAME: e2etest
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cp ./main/end-to-end-tests/e2eGitHubConfig.yml ./main/config/settings/${STAGE_NAME}.yml
./scripts/environment-deploy.sh ${STAGE_NAME}
cypress-test:
name: Cypress test
runs-on: ubuntu-18.04
needs: deploy
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install pnpm and system libraries
run: |
npm install -g pnpm
sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
- name: Install dependencies
run: pnpm install
working-directory: main/end-to-end-tests
- name: Run cypress test
run: pnpm run cypress:run-tests:github
working-directory: main/end-to-end-tests
env:
# Env parameters for cypress tests need header 'CYPRESS_' or 'cypress_'
# Cypress will strip the header and pass it to the tests
CYPRESS_BASE_URL: ${{ secrets.CYPRESS_BASE_URL}}
CYPRESS_researcherEmail: ${{ secrets.CYPRESS_RESEARCHER_EMAIL}}
CYPRESS_researcherPassword: ${{ secrets.CYPRESS_RESEARCHER_PASSWORD}}
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

All notable changes to this project will be documented in this file.

## [1.4.3] - 2020-11-24

### Added
- feat: Support Read/Write Study mounts for EC2 Windows

## [1.4.2] - 2020-11-23

### Added
- fix: Fix a bug on the update study API

We recommend to apply this patch as soon as possible

## [1.4.1] - 2020-11-18

### Added
- fix: Handling policy names for windows envs
- fix: Fix a bug on the create study API

We recommend to apply this patch as soon as possible

## [1.4.0] - 2020-11-13

### Added
- feat: Study Read/Write and Permission propagation (Goofys)
- feat: Read/Only study mounts on AWS Service Catalog based EC2 Windows workspaces

## [1.3.2] - 2020-10-23

### Added
Expand Down
53 changes: 27 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ A platform that provides researchers with one-click access to collaborative work

Platform provides one-click option to admins for easier creation (vending) of new AWS accounts specific to researchers' teams for easier governance.

For more information about various AWS accounts see [aws-accounts-readme.md](main/documentation/aws-accounts-readme.md).

The solution contains the following components:

- solution/infrastructure/
Expand All @@ -25,22 +23,25 @@ The solution also includes a Continuous Integration/Continuous Delivery feature:

## Getting Started

Node.js v12.x or later is required.
Before you can build this project, please install the following prerequisites.

Before you can build this project, you need to install [pnpm](https://pnpm.js.org/en/). Run the following command:
- **Node.Js:** [Node.js v12.x](https://nodejs.org/en/) or later is required.
- **PNPM:** Install [pnpm](https://pnpm.js.org/en/) as follows

```bash
npm install -g pnpm
$ npm install -g pnpm
```

- **Go:** You also need to install [Go](https://golang.org/doc/install). `Go` is used for creating a multipart S3 downloader tool that is used in AWS Service Catalog EC2 Windows based research environments.

To create the initial settings files, take a look at the example.yml settings file in main/config/settings/example.yml and create your own copy.
The stage is either 'example' or your username. This method should be used only for the very first time you install this solution.
In the rest of this README, \$STAGE is used to designate the stage.

Now, let's perform an initial deployment. Note that when invoked without parameters, this will assume a deployment stage of \$USER, which is the logged-in user name on Mac and Linux systems.

```bash
scripts/environment-deploy.sh
$ scripts/environment-deploy.sh
```

You can override the default stage name of \$USER if you prefer. For example, if you want your stage name to be `qa`, then:
Expand All @@ -51,51 +52,51 @@ You can override the default stage name of \$USER if you prefer. For example, if
Following an initial successful deployment, you can subsequently deploy updates to the infrastructure, backend, and post-deployment components as follows:

```bash
cd main/solution/<component>
pnpx sls deploy -s $STAGE
cd -
$ cd main/solution/<component>
$ pnpx sls deploy -s $STAGE
$ cd -
```

To run (rerun) the post-deployment steps:

```bash
cd main/solution/post-deployment
pnpx sls invoke -f postDeployment -s $STAGE
cd -
$ cd main/solution/post-deployment
$ pnpx sls invoke -f postDeployment -s $STAGE
$ cd -
```

To re-deploy the UI

```bash
cd main/solution/ui
pnpx sls package-ui --stage $STAGE --local=true
pnpx sls package-ui --stage $STAGE
pnpx sls deploy-ui --stage $STAGE --invalidate-cache=true
cd -
$ cd main/solution/ui
$ pnpx sls package-ui --stage $STAGE --local=true
$ pnpx sls package-ui --stage $STAGE
$ pnpx sls deploy-ui --stage $STAGE --invalidate-cache=true
$ cd -
```

To view information about the deployed components (e.g. CloudFront URL, root password), run the
following, where `[stage]` is the name of the environment (defaults to `$STAGE` if not provided):

```bash
scripts/get-info.sh [stage]
$ scripts/get-info.sh [stage]
```

Once you have deployed the app and the UI, you can start developing locally on your computer.
You will be running a local server that uses the same lambda functions code. To start local development, run the following commands to run a local server:

```bash
cd main/solution/backend
pnpx sls offline -s $STAGE
cd -
$ cd main/solution/backend
$ pnpx sls offline -s $STAGE
$ cd -
```

Then, in a separate terminal, run the following commands to start the ui server and open up a browser:

```bash
cd main/solution/ui
pnpx sls start-ui -s $STAGE
cd -
$ cd main/solution/ui
$ pnpx sls start-ui -s $STAGE
$ cd -
```

---
Expand Down Expand Up @@ -165,8 +166,8 @@ They are meant to provide a sample service, a sample controller and a sample UI
To audit the installed NPM packages, run the following commands:

```bash
cd <root of git repo>
pnpm audit
$ cd <root of git repo>
$ pnpm audit
```

Please follow prevailing best practices for auditing your NPM dependencies and fixing them as needed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ const StudyPermissions = types
id: types.identifier,
adminUsers: types.optional(types.array(types.string), []),
readonlyUsers: types.optional(types.array(types.string), []),
readwriteUsers: types.optional(types.array(types.string), []),
createdAt: '',
createdBy: '',
updatedAt: '',
updatedBy: '',
})
.views(_self => ({
get userTypes() {
return ['admin', 'readonly'];
return ['admin', 'readwrite', 'readonly'];
},
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const StudyPermissionsStore = BaseStore.named('StudyPermissionsStore')
const userToRequestFormat = uid => ({ uid, permissionLevel: type });

// Set selected users as "usersToAdd" (API is idempotent)
updateRequest.usersToAdd.push(...selectedUserIds[type].map(userToRequestFormat));
updateRequest.usersToAdd.push(..._.map(selectedUserIds[type], userToRequestFormat));

// Set removed users as "usersToRemove"
updateRequest.usersToRemove.push(
Expand Down
Loading

0 comments on commit 02f8ae7

Please sign in to comment.