Skip to content

Commit

Permalink
fix replace CodeCommit usage with s3
Browse files Browse the repository at this point in the history
- Overall code cleanup
- Remove unused models and classes
- Remove instance auto scaling policy
- Fix worker and SF with RemovalPolicy and updated NiceDCV AMIs
- Update documentation
- Persist workbench to allow restarts
- Updated AMI ID to reflect recent changes
  • Loading branch information
janpreusss committed Aug 23, 2024
1 parent 2705ff2 commit ece25bd
Show file tree
Hide file tree
Showing 17 changed files with 247 additions and 337 deletions.
6 changes: 4 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,23 @@ class AppModel(BaseModel):

env_dev = Environment(account=config.dev.account, region=config.dev.region)

env_name = 'dev'
if config.infra_repository_name:
PipelineStack(app, "{}-pipeline".format(config.project_name),
env_name,
config,
env=env_dev)

if config.dev.ami_factory:
AmiFactoryStack(app, "{}-dev-ami-factory".format(config.project_name),
'dev',
env_name,
config.project_name,
config.dev.ami_factory,
env=env_dev)

if config.dev.software_factory:
SoftwareFactoryStack(app, "{}-dev-software-factory".format(config.project_name),
'dev',
env_name,
config.project_name,
config.dev.software_factory,
env=env_dev)
Expand Down
36 changes: 16 additions & 20 deletions base_amis_mappings/NICE-DCV-windows-2019.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
{
"af-south-1": "ami-03a28b1d80470d9f1",
"ap-east-1": "ami-0e018cb29212e3c2c",
"ap-northeast-1": "ami-0185f9436c63606d6",
"ap-northeast-2": "ami-018fe3f0c542fec79",
"ap-south-1": "ami-062e11d3e0f0de270",
"ap-southeast-1": "ami-0c25850f7aa9d44d4",
"ap-southeast-2": "ami-05dd820eeb3633632",
"ca-central-1": "ami-0f39324ccb81a203f",
"eu-central-1": "ami-040f19c78276862a1",
"eu-north-1": "ami-04344deb81ca3b0f5",
"eu-south-1": "ami-0a545a4f9bd3857ce",
"eu-west-1": "ami-0b15c766ea9a1d61e",
"eu-west-2": "ami-012276bb2f5e8832e",
"eu-west-3": "ami-0e104db71d5e790ab",
"me-south-1": "ami-0f10781a19b675ecc",
"sa-east-1": "ami-0bfe6221c55cc4dad",
"us-east-1": "ami-0d0bc8a4d63535f70",
"us-east-2": "ami-07b97db455511a206",
"us-west-1": "ami-0e69120f94216db9f",
"us-west-2": "ami-0373b9a656ee59f1b"
"ap-south-1": "ami-0ffe80391a3223e58",
"eu-north-1": "ami-05b421add474d0675",
"eu-west-3": "ami-09a76fbd01a903c45",
"eu-west-2": "ami-0497ab04e4b0f8dbe",
"eu-west-1": "ami-05ed6655d770f88df",
"ap-northeast-2": "ami-0a17877eb79927851",
"ap-northeast-1": "ami-06fcd61683a513c8b",
"ca-central-1": "ami-0522e17c1096e7d0c",
"sa-east-1": "ami-0f8268479072dbc5f",
"ap-southeast-1": "ami-08759ca916a5fcc11",
"ap-southeast-2": "ami-042e99cef74daf858",
"eu-central-1": "ami-0ce3d8354129b16cf",
"us-east-1": "ami-03b3cfa0e7a05c83f",
"us-east-2": "ami-0249ff8e394e546dd",
"us-west-1": "ami-0c2cafa094aed8c19",
"us-west-2": "ami-0c79505ce1748ef67"
}
34 changes: 21 additions & 13 deletions blueprints/etas-autosar-cp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ and connect using with the following credentials:

Username: `Administrator`

Password: `Reinvent2023@`
Password: `Etas2024@`

![Access workbench](./docs/credentials.png)

Expand All @@ -51,7 +51,7 @@ You're good to go!

## Demo Walkthrough

1. To get started, once on the desktop, open ASCET_DEVELOPER and set the default workspace as `C:\demo_etas_git\ws`.
1. To get started, once on the desktop, open ASCET_DEVELOPER and set the default workspace as `C:\demo_etas\working-dir\ws`.

![Step 1](./docs/step1.png)

Expand All @@ -65,27 +65,35 @@ You're good to go!

4. Save your modifications.

5. Open Windows PowerShell.
5. Push your modifications to s3. On the Desktop of the workbench, you will find a shortcut named `sync-to-s3.ps1`. Using the context menu you can execute it with PowerShell. This script will compress the content of the `C:\demo_etas\working-dir` folder and copy the generated zip to the S3 bucket associated with the project. This will trigger the pipeline execution.

6. Push your modifications to the repository.
[![Step 5](./docs/step5.png)](./docs/step5.png)

```sh
cd C:/demo_etas_git/
git commit -am "changed velocity gain to 5"
git push
```
6. In the AWS Console, navigate to AWS CodePipeline, open the **project-1-dev** pipeline and you will be able to follow its execution.

7. In the AWS Console, navigate to AWS CodePipeline, open the **project-1-dev** pipeline and you will be able to follow its execution.
7. Back on the desktop, you can also open the **Artefacts** shortcut to have a look at the artefacts generated by the pipeline. They are indexed by date and commit ID. Under `<DATE>/<COMMIT_ID>/mil-tests` you will find an `index.html` file. Right-click it and open it with Google Chrome to see the results of the failed Model-In-the-Loop tests.

8. Back on the desktop, you can also open the **Artefacts** shortcut to have a look at the artefacts generated by the pipeline. They are indexed by commit ID. Under `<COMMIT_ID>/mil-tests` you will find an `index.html` file. Right-click it and open it with Google Chrome to see the results of the failed Model-In-the-Loop tests.

9. You can now start again from step **2.** by putting back the `Relative_Velocity_Gain` Default Value to **0.4**. This will result in a successful execution of the pipeline until the SiL tests, whose results can be found again directly on the desktop under the **Artefacts** shortcut.
8. You can now start again from step **2.** by putting back the `Relative_Velocity_Gain` Default Value to **0.4**. This will result in a successful execution of the pipeline until the SiL tests, whose results can be found again directly on the desktop under the **Artefacts** shortcut.

## Demo Video

Here is the re:Invent 2023 official demo video with comments on the end-to-end workflow. The underlying example (Speed Controller) is simpler than the Adaptice Cruise Controller (ACC) featured in this example. As you will not be using the Virtual Engineering Workbench, the relevant part starts at 1:40.

[![re:Invent Demo](docs/reinvent23demo.png)](https://www.youtube.com/watch?v=8cUedpXNTbY&ab_channel=AmazonWebServices)
## Provided scripts
On the desktop of the workbench, you will find two scripts: `sync-to-s3.ps1` and `restore-from-s3.ps1`.
Using the context menu you can execute the scripts with PowerShell.

[![sync-scripts](./docs/sync-scripts.png)](./docs/sync-scripts.png)

- `sync-to-s3.ps1` will compress the content of the `C:\demo_etas\working-dir` folder and copy the generated zip to the S3 bucket associated with the project. This will trigger the pipeline execution.
- `restore-from-s3.ps1` will stop any running instance of ascet and restore the workspace from the S3 bucket back to the original version. This can be used in case the working directory is corrupted or you want to start from a clean workspace.

## Why do we use S3 for source code management?

The AWS git system **code commit** has been deprecated, requiring setup changes.
The pipeline has been updated to use an S3 bucket to synchronise the workspace from the workbench to the worker instances. See the architecture diagram for the updated pipeline.
This was done to keep all project files within the AWS ecosystem and to simplify the setup.

## Tools Details

Expand Down
143 changes: 0 additions & 143 deletions blueprints/etas-autosar-cp/config-debug.yml

This file was deleted.

Loading

0 comments on commit ece25bd

Please sign in to comment.