-
Notifications
You must be signed in to change notification settings - Fork 428
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
feat(cli): add image flag to svc/job init #1473
Conversation
Service
# Your service name will be used in naming your resources like log groups, ECS services, etc.
name: my-app
# The "architecture" of the service you're running.
type: Load Balanced Web Service
image:
# The Docker image used for your service. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest.
location: 1234567890.dkr.ecr.us-west-2.amazonaws.com/my-app/my-svc:94e505c
# Port exposed through your container to route traffic to it.
port: 5000
http:
# Requests to this path will be forwarded to your service.
# To match all requests you can use the "/" path.
path: '/'
# You can specify a custom health check path. The default is "/"
# healthcheck: '/'
# You can enable sticky sessions.
# stickiness: true
# Number of CPU units for the task.
cpu: 256
# Amount of memory in MiB used by the task.
memory: 512
# Number of tasks that should be running in your service.
count: 1 Job
# Your job name will be used in naming your resources like log groups, ECS Tasks, etc.
name: my-job
# The "architecture" of the job you're running.
type: Scheduled Job
image:
# The Docker image used for your service.
location: 1234567890.dkr.ecr.us-west-2.amazonaws.com/my-app/my-svc:94e505c
# Number of CPU units for the task.
cpu: 256
# Amount of memory in MiB used by the task.
memory: 512
# The trigger for your job. You can specify a cron schedule or keyword (@weekly) or a rate (2h, 1h30m, 15m)
schedule: "@hourly" Both service and job are deployed successfully. |
6feee6d
to
9ef9011
Compare
9ef9011
to
13312ed
Compare
func stringP(s string) *string { | ||
if s == "" { |
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.
hmm is this necessary? Does {{if .ImageConfig.Location}}
evaluate to true if the pointer points to an empty string?
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.
yeah it is necessary. otherwise i tried and the result is like this:
image:
# Docker build arguments. You can specify additional overrides here. Supported: dockerfile, context, args.
build: Dockerfile
# The Docker image used for your service.
location:
# Port exposed through your container to route traffic to it.
port: 5000
9bd8067
to
3a60e65
Compare
3a60e65
to
4e6ec3c
Compare
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.
Pretty cool!
<!-- Provide summary of changes --> Add image flag to `svc init` and `job init` so that users can opt-in using existing docker image instead of building from local Dockerfile, and write to the manifest. <!-- Issue number, if available. E.g. "Fixes aws#31", "Addresses aws#42, 77" --> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Add image flag to
svc init
andjob init
so that users can opt-in using existing docker image instead of building from local Dockerfile, and write to the manifest.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.