datawire / forge

Define and run multi-container apps in Kubernetes
http://forge.sh
Apache License 2.0
415 stars 43 forks source link

Unhandled error with DescribeImages #212

Open blak3mill3r opened 6 years ago

blak3mill3r commented 6 years ago

This is a new one, I'm confused. I've been using forge successfully with 10 other projects but now with a new one it looks like I am getting an error response from AWS about a bad repositoryName.

How does forge set the repositoryName?

Since the exception is not caught I get no information about what the parameters passed to AWS were.

blake@ip-172-30-138-140:~/w/iris/iris-ingestion-pipeline/src/iris_pylon$ forge --profile=staging deploy
║ 14 tasks run, 1 errors
║   None: unexpected error
║     
║     Traceback (most recent call last):
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/core.py", line 330, in root
║         service.go(name)
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/core.py", line 323, in service
║         goal(svc)
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/cli.py", line 200, in <lambda>
║         forge.execute(lambda svc: forge.deploy(*forge.build(svc), prune=prune))
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/core.py", line 255, in build
║         self.bake(service)
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/core.py", line 200, in bake
║         raw = list(cull(lambda c: not service.docker.exists(c.image, c.version), service.containers))
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/tasks.py", line 330, in cull
║         execs.append((task.go(obj), obj))
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/tasks.py", line 313, in applicator
║         return obj(*args, **kwargs)
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/core.py", line 200, in <lambda>
║         raw = list(cull(lambda c: not service.docker.exists(c.image, c.version), service.containers))
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/docker.py", line 63, in exists
║         return self.remote_exists(name, version) or self.local_exists(name, version)
║       File "/home/blake/.pex/install/Forge-0.4.15-py2-none-any.whl.9231fb8ee2b34ba80e2fa9fab3e8592e4ca4ae54/Forge-0.4.15-py2-none-any.whl/forge/docker.py", line 354, in remote_exists
║         imageIds=[{'imageTag': version}])
║       File "/home/blake/.pex/install/botocore-1.8.36-py2.py3-none-any.whl.781cff17b450a8f61a9862444475b4b4a0f4e1a5/botocore-1.8.36-py2.py3-none-any.whl/botocore/client.py", line 317, in _api_call
║         return self._make_api_call(operation_name, kwargs)
║       File "/home/blake/.pex/install/botocore-1.8.36-py2.py3-none-any.whl.781cff17b450a8f61a9862444475b4b4a0f4e1a5/botocore-1.8.36-py2.py3-none-any.whl/botocore/client.py", line 615, in _make_api_call
║         raise error_class(parsed_response, operation_name)
║     InvalidParameterException: An error occurred (InvalidParameterException) when calling the DescribeImages operation: Invalid parameter at 'repositoryName' failed to satisfy constraint: 'must satisfy regular expression '(?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*''
blak3mill3r commented 6 years ago

just upgraded to the latest, forge 0.4.15

blak3mill3r commented 6 years ago

So, I am trying to refer to a Dockerfile in a parent directory (of the one containing service.yaml and k8s)

This is what I had in service.yaml

containers:
  - dockerfile: ../../Dockerfile
    context: .

and that caused forge to make a request to see if there was an existing repository with repositoryName of:

'pylon-..-..'

blak3mill3r commented 6 years ago

It works if I put Dockerfile in the subdirectory with service.yaml, but this does not satisfy what I'm trying to do. I want a single Docker image containing a JVM and a .jar file, but the .jar file contains code to run several services, by passing different CLI arguments to the JVM (from the k8s pod spec).

So I want a single container image which I use in 3 different services, each deployable (independently) with forge.