-
Notifications
You must be signed in to change notification settings - Fork 26
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
Update Deployment Dockerfile. Minor fixes. #99
Open
manugarri
wants to merge
5
commits into
AdRoll:master
Choose a base branch
from
manugarri:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+76
−39
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -90,7 +90,8 @@ func (pq *postgreSQLStore) Find(opts *Options) ([]*Job, error) { | |||||
log_stream_name, | ||||||
termination_requested, | ||||||
task_arn, | ||||||
array_properties | ||||||
array_properties, | ||||||
log_group_name | ||||||
FROM jobs | ||||||
` | ||||||
|
||||||
|
@@ -180,11 +181,10 @@ func (pq *postgreSQLStore) Find(opts *Options) ([]*Job, error) { | |||||
allJobs := make([]*Job, 0) | ||||||
for rows.Next() { | ||||||
var job Job | ||||||
if err := rows.Scan(&job.Id, &job.Name, &job.Status, &job.Description, &job.LastUpdated, &job.JobQueue, &job.Image, &job.CreatedAt, &job.StoppedAt, &job.VCpus, &job.Memory, &job.Timeout, &job.CommandLine, &job.StatusReason, &job.RunStartTime, &job.ExitCode, &job.LogStreamName, &job.TerminationRequested, &job.TaskARN, &job.ArrayProperties); err != nil { | ||||||
if err := rows.Scan(&job.Id, &job.Name, &job.Status, &job.Description, &job.LastUpdated, &job.JobQueue, &job.Image, &job.CreatedAt, &job.StoppedAt, &job.VCpus, &job.Memory, &job.Timeout, &job.CommandLine, &job.StatusReason, &job.RunStartTime, &job.ExitCode, &job.LogStreamName, &job.TerminationRequested, &job.TaskARN, &job.ArrayProperties, &job.LogGroupName); err != nil { | ||||||
log.Warning(err) | ||||||
return nil, err | ||||||
} | ||||||
|
||||||
allJobs = append(allJobs, &job) | ||||||
} | ||||||
return allJobs, nil | ||||||
|
@@ -249,7 +249,8 @@ func (pq *postgreSQLStore) FindOne(index string) (*Job, error) { | |||||
ta.instance_id, | ||||||
ta.public_ip, | ||||||
ta.private_ip, | ||||||
jobs.array_properties | ||||||
jobs.array_properties, | ||||||
log_group_name | ||||||
JonathanAquino-NextRoll marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
FROM jobs | ||||||
LEFT OUTER JOIN task_arns_to_instance_info ta ON | ||||||
ta.task_arn = jobs.task_arn | ||||||
|
@@ -270,7 +271,7 @@ func (pq *postgreSQLStore) FindOne(index string) (*Job, error) { | |||||
job.StatusReason = &sr | ||||||
} | ||||||
|
||||||
if err := rows.Scan(&job.Id, &job.Name, &job.Status, &job.Description, &job.LastUpdated, &job.JobQueue, &job.Image, &job.CreatedAt, &job.StoppedAt, &job.VCpus, &job.Memory, &job.Timeout, &job.CommandLine, &job.StatusReason, &job.RunStartTime, &job.ExitCode, &job.LogStreamName, &job.TerminationRequested, &job.TaskARN, &job.InstanceID, &job.PublicIP, &job.PrivateIP, &job.ArrayProperties); err != nil { | ||||||
if err := rows.Scan(&job.Id, &job.Name, &job.Status, &job.Description, &job.LastUpdated, &job.JobQueue, &job.Image, &job.CreatedAt, &job.StoppedAt, &job.VCpus, &job.Memory, &job.Timeout, &job.CommandLine, &job.StatusReason, &job.RunStartTime, &job.ExitCode, &job.LogStreamName, &job.TerminationRequested, &job.TaskARN, &job.InstanceID, &job.PublicIP, &job.PrivateIP, &job.ArrayProperties, &job.LogGroupName); err != nil { | ||||||
log.Warning(err) | ||||||
return nil, err | ||||||
} | ||||||
|
@@ -425,15 +426,16 @@ func (pq *postgreSQLStore) Store(jobs []*Job) error { | |||||
timeout, | ||||||
command_line, | ||||||
last_updated, | ||||||
status_reason, | ||||||
run_started_at, | ||||||
exitcode, | ||||||
log_stream_name, | ||||||
task_arn, | ||||||
array_properties) | ||||||
values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18) | ||||||
on conflict (job_id) do update set status = $6, last_updated = $12, status_reason = $13, run_started_at = $14, exitcode = $15, log_stream_name = $16, task_arn = $17, array_properties = $18 | ||||||
where jobs.status <> $6 or jobs.status_reason <> $13 or jobs.exitcode <> $15 or jobs.log_stream_name <> $16 or jobs.task_arn <> $17 or (jobs.task_arn is null and $17 is not null) or (jobs.log_stream_name is null and $16 is not null) or (jobs.status_reason is null and $13 is not null) or (jobs.exitcode is null and $15 is not null) | ||||||
status_reason, | ||||||
run_started_at, | ||||||
exitcode, | ||||||
log_stream_name, | ||||||
task_arn, | ||||||
array_properties, | ||||||
log_group_name) | ||||||
values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) | ||||||
on conflict (job_id) do update set status = $6, last_updated = $12, status_reason = $13, run_started_at = $14, exitcode = $15, log_stream_name = $16, task_arn = $17, array_properties = $18, log_group_name = $19 | ||||||
where jobs.status <> $6 or jobs.status_reason <> $13 or jobs.exitcode <> $15 or jobs.log_stream_name <> $16 or jobs.task_arn <> $17 or (jobs.task_arn is null and $17 is not null) or (jobs.log_stream_name is null and $16 is not null) or (jobs.status_reason is null and $13 is not null) or (jobs.exitcode is null and $15 is not null) or (jobs.log_group_name is null and $19 is not null) | ||||||
` + extra_where_check | ||||||
result, err := transaction.Exec( | ||||||
query, | ||||||
|
@@ -454,7 +456,8 @@ func (pq *postgreSQLStore) Store(jobs []*Job) error { | |||||
job.ExitCode, | ||||||
job.LogStreamName, | ||||||
job.TaskARN, | ||||||
job.ArrayProperties) | ||||||
job.ArrayProperties, | ||||||
job.LogGroupName) | ||||||
if err != nil { | ||||||
log.Warning(err, ": ", job) | ||||||
return err | ||||||
|
@@ -480,15 +483,16 @@ func (pq *postgreSQLStore) Store(jobs []*Job) error { | |||||
timeout, | ||||||
command_line, | ||||||
last_updated, | ||||||
status_reason, | ||||||
run_started_at, | ||||||
exitcode, | ||||||
log_stream_name, | ||||||
task_arn, | ||||||
array_properties) | ||||||
values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19) | ||||||
on conflict (job_id) do update set status = $6, last_updated = $13, stopped_at = $8, status_reason = $14, run_started_at = $15, exitcode = $16, log_stream_name = $17, task_arn = $18, array_properties = $19 | ||||||
where jobs.status <> $6 or jobs.status_reason <> $14 or jobs.exitcode <> $16 or jobs.log_stream_name <> $17 or jobs.task_arn <> $18 or (jobs.task_arn is null and $18 is not null) or (jobs.log_stream_name is null and $17 is not null) or (jobs.status_reason is null and $14 is not null) or (jobs.exitcode is null and $16 is not null) | ||||||
status_reason, | ||||||
run_started_at, | ||||||
exitcode, | ||||||
log_stream_name, | ||||||
task_arn, | ||||||
array_properties, | ||||||
log_group_name) | ||||||
values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20) | ||||||
on conflict (job_id) do update set status = $6, last_updated = $13, stopped_at = $8, status_reason = $14, run_started_at = $15, exitcode = $16, log_stream_name = $17, task_arn = $18, array_properties = $19, log_group_name = $20 | ||||||
where jobs.status <> $6 or jobs.status_reason <> $14 or jobs.exitcode <> $16 or jobs.log_stream_name <> $17 or jobs.task_arn <> $18 or (jobs.task_arn is null and $18 is not null) or (jobs.log_stream_name is null and $17 is not null) or (jobs.status_reason is null and $14 is not null) or (jobs.exitcode is null and $16 is not null) or (jobs.log_group_name is null and $20 is not null) | ||||||
` + extra_where_check | ||||||
result, err := transaction.Exec( | ||||||
query, | ||||||
|
@@ -510,7 +514,8 @@ func (pq *postgreSQLStore) Store(jobs []*Job) error { | |||||
job.ExitCode, | ||||||
job.LogStreamName, | ||||||
job.TaskARN, | ||||||
job.ArrayProperties) | ||||||
job.ArrayProperties, | ||||||
job.LogGroupName) | ||||||
if err != nil { | ||||||
log.Warning(err, ": ", job) | ||||||
return err | ||||||
|
@@ -906,14 +911,19 @@ func (pq *postgreSQLStore) UpdateTaskArnsInstanceIDs(ec2info map[string]Ec2Info, | |||||
if !ok { | ||||||
continue | ||||||
} | ||||||
public_ip := "" | ||||||
if ec2_info.PublicIP != nil { | ||||||
log.Info("PUBLIC IP NOT NILL", ec2_info.PublicIP) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
public_ip = *ec2_info.PublicIP | ||||||
} | ||||||
|
||||||
query := ` | ||||||
INSERT INTO task_arns_to_instance_info | ||||||
( task_arn, instance_id, public_ip, private_ip ) | ||||||
VALUES ( $1, $2, $3, $4 ) | ||||||
ON CONFLICT DO NOTHING | ||||||
` | ||||||
_, err = transaction.Exec(query, task_arn, ec2instance, ec2_info.PublicIP, ec2_info.PrivateIP) | ||||||
_, err = transaction.Exec(query, task_arn, ec2instance, public_ip, ec2_info.PrivateIP) | ||||||
if err != nil { | ||||||
log.Error("Cannot insert into task_arns_to_instance_info: ", err) | ||||||
return err | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- +goose Up | ||
-- SQL in this section is executed when the migration is applied. | ||
ALTER TABLE jobs ADD COLUMN log_group_name TEXT default '/aws/batch/job'; | ||
|
||
-- +goose Down | ||
-- SQL in this section is executed when the migration is rolled back. | ||
ALTER TABLE jobs DROP COLUMN log_group_name; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you pull from master, we don't need this line anymore. I upgraded from stretch to buster.