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

WIP: task: hostId support #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@ dist
.tern-port

# VSCode files
.vscode/
.vscode/

bundle/
6 changes: 5 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import StatsReporter, { StatsReport } from './stats_reporter';
const jwtSigningKey = fs.readFileSync(config.AsapSigningKeyFile);

const metadata = <unknown>config.InstanceMetadata;
// instanceId represents an instance, container or job id
// metadata.hostId should reflect underlying cloud instance id
const instanceDetails = <InstanceDetails>{
instanceId: config.InstanceId,
instanceType: config.InstanceType,
Expand All @@ -24,11 +26,13 @@ const commandHandler = new CommandHandler({
reconfigureScript: config.ReconfigureScript
});

// time out requests
const asapRequest = new AsapRequest({
signingKey: jwtSigningKey,
asapJwtIss: config.AsapJwtIss,
asapJwtAud: config.AsapJwtAud,
asapJwtKid: config.AsapJwtKid
asapJwtKid: config.AsapJwtKid,
requestTimeout: Math.min(3*1000, Math.floor((config.ShutdownPollingInterval * 1000)/3)),
});

const autoscalePoller = new Poller({
Expand Down
3 changes: 3 additions & 0 deletions src/autoscale_poller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import AsapRequest from './asap_request';
import logger from './logger';
import { StatsReport } from './stats_reporter';

// instanceId should match either the instance or a container or job id
// hostId may match the underlying host instance id
export interface InstanceDetails {
instanceId: string;
instanceType: string;
hostId?: string;
cloud?: string;
region?: string;
group?: string;
Expand Down
Loading