deis / builder

Git server and application builder for Deis Workflow
https://deis.com
MIT License
40 stars 41 forks source link

ref(*): use the kubernetes client directly #133

Closed aledbf closed 8 years ago

aledbf commented 8 years ago

closes #115 closes #65 closes #79

arschles commented 8 years ago

Replaces https://github.com/deis/builder/pull/115

Also, @aledbf talked offline - he'll be writing tests in this PR

arschles commented 8 years ago

Closes #79 (there are no longer any manifest files) Fixes #65

arschles commented 8 years ago

@aledbf I left a few small comments just now. My big question still remaining is - can you remove the manifest files and generate them purely from memory?

aledbf commented 8 years ago

@arschles here is the output from a push

$ git push deis master
Counting objects: 6, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 511 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
Running in debug mode
Running git hook
read [0000000000000000000000000000000000000000,75aeeee1695a35d785a49204474158e7eaf5890d,refs/heads/master]
Workflow request /v2/hooks/push (body elided)
Workflow request POST /v2/hooks/config
{"receive_user":"alejandro.debrito","receive_repo":"issue124"}
got the following config back for app issue124: {Owner:alejandro.debrito App:issue124 Values:map[] Memory:map[] CPU:map[] Tags:map[] UUID:afc70872-de58-4ce3-b692-ad84e2039509 Created:2016-01-25 21:58:49 +0000 UTC Updated:2016-01-25 21:58:49 +0000 UTC}
running [git archive --format=tar.gz --output=issue124.tar.gz 75aeeee1695a35d785a49204474158e7eaf5890d] in directory /home/git/issue124.git
running [tar -xzf issue124.tar.gz -C /tmp/] in directory /home/git/issue124.git
create bucket error: BucketAlreadyExists: The requested bucket name is not available.
remote: status code: 409, request id: 790FXO784V6IADJX
Uploading tar to http://10.3.3.23:9000/git/home/issue124:git-75aeeee1/tar
-----> Starting build... but first, coffee!
Starting pod slugbuild-issue124-75aeeee1-e692d8c3
Pod spec: {
  "metadata": {
    "name": "slugbuild-issue124-75aeeee1-e692d8c3",
    "namespace": "deis",
    "creationTimestamp": null,
    "labels": {
      "heritage": "deis",
      "version": "2.0.0-beta"
    }
  },
  "spec": {
    "volumes": [
      {
        "name": "minio-user",
        "secret": {
          "secretName": "minio-user"
        }
      }
    ],
    "containers": [
      {
        "name": "deis-slugbuilder",
        "image": "quay.io/deisci/slugbuilder:v2-beta",
        "env": [
          {
            "name": "TAR_URL",
            "value": "http://10.3.3.23:9000/git/home/issue124:git-75aeeee1/tar"
          },
          {
            "name": "put_url",
            "value": "http://10.3.3.23:9000/git/home/issue124:git-75aeeee1695a35d785a49204474158e7eaf5890d/push"
          }
        ],
        "resources": {},
        "volumeMounts": [
          {
            "name": "minio-user",
            "readOnly": true,
            "mountPath": "/var/run/secrets/object/store"
          }
        ],
        "imagePullPolicy": "Always"
      }
    ],
    "restartPolicy": "Never",
    "serviceAccountName": ""
  },
  "status": {}
}

-----> Unable to select a buildpack ---> (this is "expected", there's only a Procfile file in the directory)
size of logs streamed 40
-----> Build complete.
-----> Launching app.
-----> Launching...
Workflow request POST /v2/hooks/build
{"sha":"75aeeee1695a35d785a49204474158e7eaf5890d","receive_user":"alejandro.debrito","receive_repo":"issue124","image":"issue124","procfile":{"web":"true"},"dockerfile":""}
[DEBUG]
-----> Done, issue124:v6 deployed to Deis

-----> Use 'deis open' to view this application in your browser

-----> To learn more, use 'deis help' or visit http://deis.io

running [git gc] in directory /home/git/issue124.git
To ssh://git@deis-v2:2222/issue124.git
 * [new branch]      master -> master
arschles commented 8 years ago

@aledbf made a few more comments. Also, does this PR fix https://github.com/deis/builder/issues/65?

aledbf commented 8 years ago

Also, does this PR fix #65?

Yes

arschles commented 8 years ago

Fixes #65

arschles commented 8 years ago

@aledbf I tested on my GKE cluster, and all looks good:

ENG000656:example-go aaronschlesinger$ git push deis master
The authenticity of host '[deis.104.197.73.56.xip.io]:2222 ([104.197.73.56]:2222)' can't be established.
ECDSA key fingerprint is SHA256:pa0axGD3ZJnbdsHCI/dGsWL083DueYSBFMfwjpnSbQ0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[deis.104.197.73.56.xip.io]:2222,[104.197.73.56]:2222' (ECDSA) to the list of known hosts.
Counting objects: 115, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (110/110), done.
Writing objects: 100% (115/115), 20.76 KiB | 0 bytes/s, done.
Total 115 (delta 66), reused 0 (delta 0)
-----> Starting build... but first, coffee!
-----> Go app detected
-----> Checking Godeps/Godeps.json file.
-----> Installing go1.4.2... done
-----> Running: godep go install -tags heroku ./...
-----> Discovering process types
       Procfile declares types -> web
-----> Compiled slug size is 1.7M
-----> Build complete.
-----> Launching app.
-----> Launching...
-----> Done, gotest:v2 deployed to Deis

-----> Use 'deis open' to view this application in your browser

-----> To learn more, use 'deis help' or visit http://deis.io

To ssh://git@deis.104.197.73.56.xip.io:2222/gotest.git
 * [new branch]      master -> master
technosophos commented 8 years ago

This is fantastic! Thanks!