Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(infra): Fix the cog batch job to put record to dynamodb. #2197

Merged
merged 3 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
5 changes: 4 additions & 1 deletion packages/_infra/src/cogify/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { createHash } from 'crypto';
import { TileMetadataTableArn } from '../serve/db.js';
import { ScratchData } from './mount.folder.js';
import { Construct } from 'constructs';
import { getConfig } from '../config.js';

/**
* Cogification infrastructure
Expand Down Expand Up @@ -126,6 +127,8 @@ export class CogBuilderStack extends cdk.Stack {
},
});

const config = getConfig();

new batch.CfnJobDefinition(this, 'CogBatchJobDef', {
jobDefinitionName: 'CogBatchJob',
type: 'container',
Expand All @@ -145,7 +148,7 @@ export class CogBuilderStack extends cdk.Stack {
* Eg a instance with 8192MB allocates 7953MB usable
*/
memory: 3900,
environment: [{ name: Env.TempFolder, value: ScratchData.Folder }],
environment: [{ name: Env.TempFolder, value: ScratchData.Folder, [Env.PublicUrlBase]: config.PublicUrlBase }],
mountPoints: [{ containerPath: ScratchData.Folder, sourceVolume: 'scratch' }],
volumes: [{ name: 'scratch', host: { sourcePath: ScratchData.Folder } }],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/_infra/src/serve/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const TileMetadataTableArn = {
return cdk.Arn.format(
{
service: 'dynamodb',
region: '*',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this will fix the problem, this was to allow other regions to write to dynamodb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I need to have a look what cause the problem. Just don't how to test this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is it coming from, do you have the bundled index.js to see the stack trace?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, That's what I am thinking to get a bundle index.js first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
This the place of error, I can't find where is the place to using this.
However, I am sure ti broke at the place for puting item to dynamodb.

region: Const.Aws.Region,
resource: 'table',
resourceName: Const.TileMetadata.TableName,
},
Expand Down