datawire / forge

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

forge setup fails on mac with private registry #204

Open robertmircea opened 6 years ago

robertmircea commented 6 years ago

I am trying to run forge setup on a mac with a private registry offered by an internal JFrog Artifactory server. I cannot finish the setup process due to the following error:

● ● λ forge setup
║ == Checking Kubernetes Setup ==
║
║ kubectl version --short
║ Client Version: v1.9.6
║ Server Version: v1.9.5
║ 1 tasks run, 0 errors
║ kubectl get service kubernetes --namespace default
║ NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
║ kubernetes   ClusterIP   10.233.0.1   <none>        443/TCP   35d
║ 1 tasks run, 0 errors
║
║ == Setting up Docker ==
║
║ Registry type (one of ecr, gcr, generic)[generic]:
║ Docker registry url[registry.hub.docker.com]: dev.artifactory.xyz.intra
║ Docker user (use "-" to leave unspecified): auser
║ Docker password:
║ Docker namespace/organization (enter username again for standard accounts): online
║
║ registry: {type: docker, url: dev.artifactory.xyz.intra, user: auser,
║   password: 'ABCDEF
║
║     ', namespace: online}
║
║ docker login -u auser -p <ELIDED> dev.artifactory.xyz.intra
║ WARNING! Using --password via the CLI is insecure. Use --password-stdin.
║ WARNING! Your password will be stored unencrypted in /Users/robert/.docker/config.json.
║ Configure a credential helper to remove this warning. See
║ https://docs.docker.com/engine/reference/commandline/login/#credentials-store
║
║ Login Succeeded
║ docker pull registry.hub.docker.com/datawire/forge-setup-test:1
║ 1: Pulling from datawire/forge-setup-test
║ Digest: sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96
║ Status: Image is up to date for registry.hub.docker.com/datawire/forge-setup-test:1
║ docker tag registry.hub.docker.com/datawire/forge-setup-test:1 dev.artifactory.xyz.intra/online/forge_test:dummy
║ docker push dev.artifactory.xyz.intra/online/forge_test:dummy
║ The push refers to repository [dev.artifactory.xyz.intra/online/forge_test]
║ e154057080f4: Preparing
║ e154057080f4: Layer already exists
║ dummy: digest: sha256:11a6af2edd09100d7a35abacacefd269404cf44aff537668235321d4f4caa485 size: 528
║ GET https://dev.artifactory.xyz.intra/v2/online/forge_test/manifests/dummy
║ 16 tasks run, 1 errors
║   setup: HTTPSConnectionPool(host='dev.artifactory.xyz.intra', port=443): Max retries exceeded with url: /v2/online/forge_test/manifests/dummy (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10cb16990>: Failed to establish a new connection: [Errno 8] No address found',))
║
║ -- please try again --

Any hint on how to solve this issue?

richarddli commented 6 years ago

Hello, thanks for the bug report! You can create a forge.yaml file by hand, following the documentation here:

https://forge.sh/docs/reference/forge-config

In particular, if you can get docker login to your private registry, Forge should be able to work (and you don't need to put credentials in the file). Here's an example GCR forge.yaml file:

https://github.com/datawire/bb-kubecon/blob/master/forge.yaml

robertmircea commented 6 years ago

I've created it after submitting the above report. The same error appears now on forge build docker login works properly. I can push images into the private registry using docker push.

λ forge build
║ 19 tasks run, 1 errors
║   whoami: HTTPSConnectionPool(host='dev.artifactory.xyz.intra', port=443): Max retries exceeded with url: /v2/online/whoami/manifests/f5bbed8fa0c4e9f7805003477266dfc720b71697.git (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x108283150>: Failed to establish a new connection: [Errno 8] No address found',))
richarddli commented 6 years ago

Can you paste your forge.yaml?

robertmircea commented 6 years ago

Here you are:

cat forge.yaml
registry:
  type: docker
  url: dev.artifactory.xyz.intra
  verify: false
  namespace: online
richarddli commented 6 years ago

Hm, it could be an incompatibility with the artifactory (we've found that different registries have subtly different semantics). We'll take a look but it might be a few days before we can get to this.

whybeyoung commented 5 years ago

ignore the setup , and create forge.yaml by hand. No problem. setup is intended to genreate a forge.yaml.