Coder Social home page Coder Social logo

"knctl deploy --wait" about knctl HOT 6 CLOSED

drnic avatar drnic commented on May 29, 2024
"knctl deploy --wait"

from knctl.

Comments (6)

drnic avatar drnic commented on May 29, 2024

FWIW, my little post-install sanity test script is:

    kubectl create ns bootstrap-test
    knctl deploy \
      --namespace bootstrap-test \
      --service hello \
      --image gcr.io/knative-samples/helloworld-go \
      --env TARGET=Bootstrap

    podStatus=Init
    while [[ "${podStatus}" != "Running" ]]; do
      sleep 2
      podStatus=$(kubectl get pods -n bootstrap-test -l serving.knative.dev/configuration=hello -o jsonpath="{.items[0].status.phase}")
      echo "  ${podStatus}"
    done
    knctl curl -n bootstrap-test -s hello

from knctl.

cppforlife avatar cppforlife commented on May 29, 2024

@drnic yeah, that sounds good, i wonder if this should be default behaviour? additionally we could show logs until app successfully starts (if it fails, logs may have some nice error messages for debugging).

from knctl.

drnic avatar drnic commented on May 29, 2024

Thinking more about it (and as you've inferred above): a "valid" outcome of knctl deploy --directory . (or other sources) is that the app will fail to build and/or fail to run. So we need to terminate on a range of pod phases?

Yeah, dumping any pod logs is a good idea. We're already doing this for the build phase.

from knctl.

cppforlife avatar cppforlife commented on May 29, 2024

added basic impl on master (not published yet). deploy wait for default and blocks for at least 5s to collect some logs (may be app fails a little bit later after it starts). check it out.

from knctl.

cppforlife avatar cppforlife commented on May 29, 2024

addressed in v0.0.10

from knctl.

cppforlife avatar cppforlife commented on May 29, 2024

example output:

$ knctl deploy -s py -d . -i docker.io/dkalinin/py-app --service-account serv-acct1
Name  py

Waiting for new revision (after revision 'py-00010') to be created...

Tagging new revision 'py-00011' as 'latest'

Tagging older revision 'py-00010' as 'previous'

[2018-11-07T15:09:20-08:00] Uploading source code...

[2018-11-07T15:09:26-08:00] Finished uploading source code...

Watching build logs...

build-step-credential-initializer | {"level":"info","ts":1541632161.9170043,"logger":"fallback-logger","caller":"creds-init/main.go:40","msg":"Credentials initialized."}
build-step-build-and-push | INFO[0000] Downloading base image python:3.7-slim
build-step-build-and-push | ERROR: logging before flag.Parse: E1107 23:09:27.532192       1 metadata.go:142] while reading 'google-dockercfg' metadata: http status code: 404 while fetching url http://metadata.google.internal./computeMetadata/v1/instance/attributes/google-dockercfg
build-step-build-and-push | ERROR: logging before flag.Parse: E1107 23:09:27.536554       1 metadata.go:159] while reading 'google-dockercfg-url' metadata: http status code: 404 while fetching url http://metadata.google.internal./computeMetadata/v1/instance/attributes/google-dockercfg-url
build-step-build-and-push | INFO[0000] Executing 0 build triggers
build-step-build-and-push | INFO[0004] Taking snapshot of full filesystem...
build-step-build-and-push | INFO[0007] CMD ["python", "-m", "flask", "run", "--host=0.0.0.0", "--port=8080"]
build-step-build-and-push | INFO[0007] ENV FLASK_DEBUG=1
build-step-build-and-push | INFO[0007] ENV FLASK_APP=app.py
build-step-build-and-push | INFO[0007] Using files from context: [/workspace/requirements.txt]
build-step-build-and-push | INFO[0007] COPY requirements.txt .
build-step-build-and-push | INFO[0007] Taking snapshot of files...
build-step-build-and-push | INFO[0007] RUN pip install -r requirements.txt
build-step-build-and-push | INFO[0007] cmd: /bin/sh
build-step-build-and-push | INFO[0007] args: [-c pip install -r requirements.txt]
build-step-build-and-push | Collecting Flask==1.0 (from -r requirements.txt (line 1))
build-step-build-and-push |   Downloading https://files.pythonhosted.org/packages/55/b1/4365193655df97227ace49311365cc296e74b60c7f5c63d23cd30175e2f6/Flask-1.0-py2.py3-none-any.whl (97kB)
build-step-build-and-push | Collecting Jinja2>=2.10 (from Flask==1.0->-r requirements.txt (line 1))
build-step-build-and-push |   Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
build-step-build-and-push | Collecting itsdangerous>=0.24 (from Flask==1.0->-r requirements.txt (line 1))
build-step-build-and-push |   Downloading https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
build-step-build-and-push | Collecting Werkzeug>=0.14 (from Flask==1.0->-r requirements.txt (line 1))
build-step-build-and-push |   Downloading https://files.pythonhosted.org/packages/20/c4/12e3e56473e52375aa29c4764e70d1b8f3efa6682bef8d0aae04fe335243/Werkzeug-0.14.1-py2.py3-none-any.whl (322kB)
build-step-build-and-push | Collecting click>=5.1 (from Flask==1.0->-r requirements.txt (line 1))
build-step-build-and-push |   Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
build-step-build-and-push | Collecting MarkupSafe>=0.23 (from Jinja2>=2.10->Flask==1.0->-r requirements.txt (line 1))
build-step-build-and-push |   Downloading https://files.pythonhosted.org/packages/e4/c4/adcc2d6f2ac2146cc04e076f14f1006c1de8e1e747fa067668b6573000b8/MarkupSafe-1.1.0-cp37-cp37m-manylinux1_x86_64.whl
build-step-build-and-push | Installing collected packages: MarkupSafe, Jinja2, itsdangerous, Werkzeug, click, Flask
build-step-build-and-push | Successfully installed Flask-1.0 Jinja2-2.10 MarkupSafe-1.1.0 Werkzeug-0.14.1 click-7.0 itsdangerous-1.1.0
build-step-build-and-push | INFO[0010] Taking snapshot of full filesystem...
build-step-build-and-push | INFO[0013] Using files from context: [/workspace/app.py]
build-step-build-and-push | INFO[0013] COPY *.py .
build-step-build-and-push | INFO[0013] Taking snapshot of files...
build-step-build-and-push | 2018/11/07 23:09:41 existing blob: sha256:26e8d4265cb7312772b17603e4a0d535706088094ce3fb1ca20537a8135bfa68
build-step-build-and-push | 2018/11/07 23:09:41 existing blob: sha256:9e9d5ac4176e2833b7027727422f42a82b6dee1abafba3e9f3b43ccadf4d2bd0
build-step-build-and-push | 2018/11/07 23:09:41 existing blob: sha256:78d468b574cec1c8eb5942547eaf13e82094ff964240bb253713f8bb0458fa60
build-step-build-and-push | 2018/11/07 23:09:41 existing blob: sha256:f17d81b4b692f7e0d6c1176c86b81d9f2cb5ac5349703adca51c61debcfe413c
build-step-build-and-push | 2018/11/07 23:09:41 existing blob: sha256:fbffd6f4e5964882f4d7535c7481069fda0817abab4dd44177213ecc1e9c3781
build-step-build-and-push | 2018/11/07 23:09:41 pushed blob sha256:62932c0cd5cdce96360be186e15832dfcc247bb878e205f5e5d2d96e15e48109
build-step-build-and-push | 2018/11/07 23:09:41 pushed blob sha256:b2c569485018cc161f7bff00bee07169877d258da2521c8dfc55aa0e096b41af
build-step-build-and-push | 2018/11/07 23:09:42 pushed blob sha256:bf45e9187bb2b495401cd6f2a36401edfe7dd434ef9ec25e10aafb80cd4a1c44
build-step-build-and-push | 2018/11/07 23:09:43 pushed blob sha256:60513d30d5d1f8cf81b7cee4e4c600728f53ae398199077d3bdc5f062388240b
build-step-build-and-push | 2018/11/07 23:09:43 index.docker.io/dkalinin/docker-rails-failing:latest: digest: sha256:a7b8fde1f6d004ff21bc1e2d76b28e894e4e932d8ade70dcce20e6735ebfd9be size: 1566
nop | Build successful

Waiting for new revision 'py-00011' to be ready for up to 5m0s (logs below)...

py-00011 > py-00011-deployment-85697db6b8-qxb96 |  * Serving Flask app "app.py" (lazy loading)
py-00011 > py-00011-deployment-85697db6b8-qxb96 |  * Environment: production
py-00011 > py-00011-deployment-85697db6b8-qxb96 |    WARNING: Do not use the development server in a production environment.
py-00011 > py-00011-deployment-85697db6b8-qxb96 |    Use a production WSGI server instead.
py-00011 > py-00011-deployment-85697db6b8-qxb96 |  * Debug mode: on
py-00011 > py-00011-deployment-85697db6b8-qxb96 |  * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
py-00011 > py-00011-deployment-85697db6b8-qxb96 |  * Restarting with stat
py-00011 > py-00011-deployment-85697db6b8-qxb96 |  * Debugger is active!
py-00011 > py-00011-deployment-85697db6b8-qxb96 |  * Debugger PIN: 211-950-084

Revision 'py-00011' became ready

Continuing to watch logs for 5s before exiting

Succeeded

from knctl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.