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

Issues deploying to ECS #9

Open
vigneshsenapathy opened this issue Jun 9, 2017 · 19 comments
Open

Issues deploying to ECS #9

vigneshsenapathy opened this issue Jun 9, 2017 · 19 comments

Comments

@vigneshsenapathy
Copy link

Hello @calvn ,

I am having trouble deploying git2consul to ecs.

I am getting the following error:
Config value is not valid JSON: undefined

below are the values i am using
config_file={"version":"1.0","repos":[{"name":"config","url":"github.com/test.git","include_branch_name":false,"source_root":"test","ignore_file_extension" : true,"branches":["master"],"hooks":[{"type":"polling","interval":"1"}]}]}

endpoint=consul
port=8500

I am using ur image also i check to make sure my config file is right or not and it is rendering a valid json.

Can you help me out in this

Thanks,

Vignesh

@calvn
Copy link
Contributor

calvn commented Jun 9, 2017

Can you test the same command that you are using directly/locally in docker? If that works, then it is probably an issue with the task definition template in ECS.

@vigneshsenapathy
Copy link
Author

@calvn let me try it again.. u just want me to start it like how is do it in taskdef template right?

@calvn
Copy link
Contributor

calvn commented Jun 9, 2017

That's correct, and you can also share that command in here.

@vigneshsenapathy
Copy link
Author

@calvn : can the config_file be directly be inserted as a env variable? that wat i am doing as i didnt create any file on the container

@calvn
Copy link
Contributor

calvn commented Jun 9, 2017

That is not possible, the config file needs to be a file in the container.

@calvn
Copy link
Contributor

calvn commented Jun 9, 2017

What you can do is use something like kickstarter/docker-s3-sync to place a config file from s3 to the host, and mount the volume (i.e. directory) that contains that file to the container via the task definition template.

@vigneshsenapathy
Copy link
Author

@calvn so i just need to mount it right to /tmp/git2consul.d/config.json?

@vigneshsenapathy
Copy link
Author

can the config_file be passed as a env variable as
config_file=/tmp/git2consul.d/config.json?

@calvn
Copy link
Contributor

calvn commented Jun 9, 2017

It cannot; it has to be passed in as an option flag. If that's the location where the config file lives in the host and you are passing in --config_file /tmp/git2consul.d/config.json, then you mount /tmp/git2consul.d:/tmp/git2consul.d

@vigneshsenapathy
Copy link
Author

@calvn do u know how i can do this in ECS. Have you started git2consul using ecs?

@vigneshsenapathy
Copy link
Author

@calvn : in ecs i looks something like this

    env:
    - name: config_file
      value: '{"version":"1.0","repos [{"name":"config","url":"https://user:[email protected]:org/repo.git","branches":["master"],"hooks":[{"type":"polling","interval":"1"}]}]}'
    - name: endpoint
      value: "10.244.4.241"
    - name: port
      value: "8500"

@calvn
Copy link
Contributor

calvn commented Jun 9, 2017

I have done so before with docker-s3-sync, so I know that it should work. Unfortunately, I no longer have the template file handy. I'd say go and give it a try, as the AWS docs are pretty extensive on how to run multiple containers and perform mounts.

@vigneshsenapathy
Copy link
Author

@calvn : all i would need to do is mount it right ? if i mount the drive i can use it right

@calvn
Copy link
Contributor

calvn commented Jun 9, 2017

As I've said before, that won't work! You can't pass in the config file via env.

@vigneshsenapathy
Copy link
Author

how do i pass options in ecs? i am trying to find that in task def, but not able to find it

@calvn
Copy link
Contributor

calvn commented Jun 9, 2017

There is an example template in http://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-task-definition.html. There is a section for command:

...
  "command": [
    ""
  ],
...

@vigneshsenapathy
Copy link
Author

vigneshsenapathy commented Jun 9, 2017

@calvn : I am doing the following

Command ["--endpoint consul.predev01 --port 8500 --config_file /tmp/git2consul.d/config.json"]

i am still getting error. The config.json is mounted. should i say git2consul --endpoint consul.predev01 --port 8500 --config_file /tmp/git2consul.d/config.json or i there a diffgerent command

@sureshcjc
Copy link

sureshcjc commented Nov 8, 2017

hi @calvn ,

I'm using circlce job to push git2consul config.json and building a new image from git2consul image.

im having similar issue, but it is probably on the endpoint param. when the container is brought up it says it cant connect to consul. Below is my dockercompose and could there be anything wrong in there?

version: "2"
services:
git-consul:
image: git2consul-image-with-config
mem_limit: 1024m
build: .
command: ["export LOCAL_IP=$$(curl http://169.254.169.254/latest/meta-data/local-ipv4); --endpoint=$$LOCAL_IP --port=8500 --config-file=/etc/git2consul.d/config.json"]

@sureshcjc
Copy link

compose file is valid, its just not formatted here when i copied :)
btw, the build image contains the config.json in the specified folder

thanks ahead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants