Skip to content

Commit

Permalink
remove unnecessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
William Sia committed Oct 3, 2024
1 parent 134c157 commit f1b4b62
Show file tree
Hide file tree
Showing 23 changed files with 77 additions and 896 deletions.
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
"formatFiles.excludePattern": "*.log,*.tsbuildinfo",
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
}
},

"files.exclude": {
"**/*.js": true,
"**/*.map": true
}
}
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ To dive deep into AGIE components, please visit the following links:
- [UI Module](typescript/packages/apps/ui)

### Success

Upon successful deployment of this guidance, you will be able to do the following:

- Enroll polygons (areas of interest, farm fields, geographical areas of land) for processing and analysis
- Schedule the frequency of polygon analysis, for each polygon, to support one-time and recurring automated processing
- Automate the searching, downloading, clipping, and processing of earth observation data into NDVI maps and meta data, per polygon
Expand Down Expand Up @@ -64,13 +66,12 @@ You will need to pay for the AWS services used while running this guidance. As o
In order to deploy `AGIE` from your local workstation, you need to install the following dependencies:

- Active AWS Account
- Node.js 20.x
- [Node.js 20.x](https://nodejs.org/en/download/package-manager)
- [AWS Command Line Interface](https://aws.amazon.com/cli/)
- [Docker](https://docs.docker.com/engine/install/)
- [Rush.js](https://rushjs.io/)
- [pnpm 9.0.2](https://www.npmjs.com/package/pnpm/v/9.0.2)
- [tsx](https://www.npmjs.com/package/tsx/v/4.18.0)
- NOTE: AWS AGIE includes an optional UI module. The optional and integrated UI module includes functionality provided by Amazon Location Service. As of 7/24, Amazon Location Service is not available in certain AWS Regions, including us-west-1. Please review the most current list of Region availability of Amazon Location Service to ensure the optional UI module can be deployed within a Region that meets your company requirements.

> NOTE: AWS AGIE includes an optional UI module. The optional and integrated UI module includes functionality provided by Amazon Location Service. As of 7/24, Amazon Location Service is not available in certain AWS Regions, including us-west-1. Please review the most current list of Region availability of Amazon Location Service to ensure the optional UI module can be deployed within a Region that meets your company requirements.
## Deployment

Expand All @@ -79,10 +80,10 @@ In order to deploy `AGIE` from your local workstation, you need to install the f
Run the following command to clone the solution repository into your local workstation:

```shell
$ git clone https://github.com/aws-solutions-library-samples/guidance-for-automated-geospatial-insights-engine-on-aws
$ cd guidance-for-automated-geospatial-insights-engine-on-aws
$ export AGIE_FOLDER=$PWD
$ export CLI_FOLDER="$PWD/typescript/packages/apps/cli"
git clone https://github.com/aws-solutions-library-samples/guidance-for-automated-geospatial-insights-engine-on-aws
cd guidance-for-automated-geospatial-insights-engine-on-aws
export AGIE_FOLDER=$PWD
export CLI_FOLDER="$PWD/typescript/packages/apps/cli"
```

### 2. Build the solution
Expand Down
6 changes: 6 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions typescript/packages/apps/cli/bin/dev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env tsx --trace-warnings
#!/usr/bin/env npx tsx --trace-warnings

/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
Expand All @@ -12,16 +12,13 @@
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
import path from 'path';
import oclif from '@oclif/core';
import { fileURLToPath } from 'url';
import path from 'path';
import tsNode from 'ts-node';
import dotenv from 'dotenv';
import loadValidatorFunction from './validator';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
dotenv.config({ path: path.join(__dirname, '../.env') });

const project = path.join(__dirname, '../', 'tsconfig.json');

Expand All @@ -33,7 +30,5 @@ tsNode.register({ project });
// In dev mode, always show stack traces
oclif.settings.debug = true;

loadValidatorFunction();

// Start the CLI
await oclif.execute({ development: true, dir: project });
74 changes: 0 additions & 74 deletions typescript/packages/apps/cli/bin/validator

This file was deleted.

3 changes: 2 additions & 1 deletion typescript/packages/apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
"simple-git": "~3",
"replace-in-file": "~7",
"validator": "~13",
"rxjs": "~7"
"rxjs": "~7",
"tsx": "~4"
},
"devDependencies": {
"@oclif/test": "~3",
Expand Down
7 changes: 4 additions & 3 deletions typescript/packages/apps/cli/src/commands/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { getParameterValue } from '../utils/ssm.js';

export interface AuthorizerUserProps {
environment: string;
region?: string;
region: string;
username: string;
password: string;
newPassword?: string;
Expand Down Expand Up @@ -64,8 +64,8 @@ export class Auth extends DeploymentCommand<typeof Auth> {
];

private async generateAuthToken(props: AuthorizerUserProps): Promise<string> {
const userPoolClientId = await getParameterValue(userPoolClientIdParameter(props.environment));
const userPoolId = await getParameterValue(userPoolIdParameter(props.environment));
const userPoolClientId = await getParameterValue(userPoolClientIdParameter(props.environment), props.region);
const userPoolId = await getParameterValue(userPoolIdParameter(props.environment), props.region);

Amplify.configure({
Auth: {
Expand Down Expand Up @@ -117,6 +117,7 @@ export class Auth extends DeploymentCommand<typeof Auth> {
username: flags.username,
password: flags.password,
newPassword: flags.newPassword,
region: flags.region,
});
console.log(token);
} catch (error) {
Expand Down
34 changes: 0 additions & 34 deletions typescript/packages/apps/cli/src/commands/init.ts

This file was deleted.

24 changes: 17 additions & 7 deletions typescript/packages/apps/cli/src/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export class AgieInstall extends AgieCommand<typeof AgieInstall> {
char: 'h',
description: 'If provided, bypass the questions. You will also need to specify the path configuration file using -c',
dependsOn: ['config'],
default: false,
}),
role: Flags.string({
description: 'The RoleArn for the CLI to assume for deployment.',
Expand All @@ -69,7 +68,7 @@ export class AgieInstall extends AgieCommand<typeof AgieInstall> {

const installTasks = await this.getAgieInstallTask(flags.role!, region, rest);

const taskRunner: Listr = new Listr([this.getStacServerBundleTask(), ...installTasks]);
const taskRunner: Listr = new Listr([this.getStacServerBundleTask(), ...installTasks], { exitOnError: true });

await taskRunner.run({ answers });
}
Expand Down Expand Up @@ -118,6 +117,8 @@ export class AgieInstall extends AgieCommand<typeof AgieInstall> {
task: async (_, task) => {
try {
await getDeployedStackByName('CDKToolkit', region, role);
task.skip('Skip boostrapping cdk');
return;
} catch (error) {
if ((error as Error).message === 'Stack with id CDKToolkit does not exist') {
task.output = `CDK has not been bootstrapped in ${region}, running bootstrap...`;
Expand All @@ -134,7 +135,7 @@ export class AgieInstall extends AgieCommand<typeof AgieInstall> {
},
{
title: 'Deploying AGIE stacks',
task: async () => {
task: async (ctx, task) => {
return new Observable((observer) => {
shell.cd(infrastructureFolder);

Expand All @@ -151,8 +152,12 @@ export class AgieInstall extends AgieCommand<typeof AgieInstall> {
observer.next(data);
});

child.on('exit', function () {
observer.complete();
child.on('exit', function (code: number) {
if (code === 1) {
observer.error('Encountered error when deploying AGIE stacks');
} else {
observer.complete();
}
});
});
},
Expand All @@ -170,8 +175,13 @@ export class AgieInstall extends AgieCommand<typeof AgieInstall> {
child?.stderr?.on('data', function (data) {
observer.next(data);
});
child.on('exit', function () {
observer.complete();

child.on('exit', function (code: number) {
if (code === 1) {
observer.error('Encountered error when deploying the demo UI');
} else {
observer.complete();
}
});
});
},
Expand Down
8 changes: 6 additions & 2 deletions typescript/packages/apps/cli/src/commands/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ export class AgieRemove extends AgieCommand<typeof AgieRemove> {
observer.next(data);
});

child.on('exit', function () {
observer.complete();
child.on('exit', function (code: number) {
if (code === 1) {
observer.error('Encountered error when removing AGIE stacks');
} else {
observer.complete();
}
});
});
},
Expand Down
24 changes: 0 additions & 24 deletions typescript/packages/apps/cli/src/custom-typings/conf.d.ts

This file was deleted.

Loading

0 comments on commit f1b4b62

Please sign in to comment.