Giter VIP home page Giter VIP logo

Comments (17)

jponge avatar jponge commented on August 25, 2024

dekorate-and-vertx.zip

from hal.

jponge avatar jponge commented on August 25, 2024

@metacosm here's the project we talked about on Zulip

from hal.

metacosm avatar metacosm commented on August 25, 2024

@jponge the given project doesn't compile. Also, with hal master, you do need to hal component create the project before you do a push.

from hal.

jponge avatar jponge commented on August 25, 2024

from hal.

metacosm avatar metacosm commented on August 25, 2024

I've fixed the project so that it builds properly. Looking at the other issues now :)

from hal.

metacosm avatar metacosm commented on August 25, 2024

What’s the error?

Basically, I don't have a vert.x 4 snapshot and didn't have a dekorate 0.9-SNAPSHOT either. Switched to vert.x 3.8.2 and dekorate 0.9.3…

from hal.

jponge avatar jponge commented on August 25, 2024

from hal.

metacosm avatar metacosm commented on August 25, 2024

Can you give it another try, @jponge, please?

from hal.

jponge avatar jponge commented on August 25, 2024

I've upgraded to the latest hal on the master branch.

First thing hal component create is a bit confusing since it also offers scaffolding.
I eventually figured out how to use it, but I had to go to the parent folder of my project:

➜  dekorate-and-vertx cd ..
➜  playgrounds hal component create dekorate-and-vertx
? Runtime vert.x
? Version 3.8.2
? Expose microservice Yes
? Port 8080
? Use code generator No
? Local component directory dekorate-and-vertx
? Env variable in the 'name=value' format, simply press enter when finished
❯ Selected Name: dekorate-and-vertx
 ✓  Successfully created 'dekorate-and-vertx' component

I then did a push which looked ok on the surface:

➜  dekorate-and-vertx hal component push
Local changes detected for 'dekorate-and-vertx' component: about to push source code to remote cluster
 ✓  Uploading /Users/jponge/Code/playgrounds/dekorate-and-vertx/dekorate-and-vertx.tar
 ✓  Cleaning up component
 ✓  Extracting source on the remote cluster
 ✓  Performing build
 ✓  Restarting app
 ✓  Successfully pushed 'dekorate-and-vertx' component to remote cluster

It took me a while to figure out that this had pushed the source code but that nothing had actually been built / deployed.

I eventually discovered the -b flag:

➜  dekorate-and-vertx hal component push -b
Local changes detected for 'dekorate-and-vertx' component: about to push packaged binary to remote cluster
 ✓  Uploading /Users/jponge/Code/playgrounds/dekorate-and-vertx/target/dekorate-and-vertx-0.0.0-SNAPSHOT-all.jar
 ✓  Restarting app
 ✓  Successfully pushed 'dekorate-and-vertx' component to remote cluster

But the service has no external IP:

➜  dekorate-and-vertx kubectl get components
NAME                 RUNTIME   VERSION   AGE   MODE   STATUS   MESSAGE                                                             REVISION
dekorate-and-vertx   vert.x    3.8.2     10m   dev    Ready    Ready: 'PodName' changed to 'dekorate-and-vertx-85fcfff4d6-5nc7t'   e10d5df6c0725078778ec3b76ff92c06f7d3900b
➜  dekorate-and-vertx kubectl get services
NAME                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
dekorate-and-vertx   ClusterIP   10.104.157.62   <none>        8080/TCP   10m
kubernetes           ClusterIP   10.96.0.1       <none>        443/TCP    5d11h
➜  dekorate-and-vertx minikube service --url dekorate-and-vertx
😿  service default/dekorate-and-vertx has no node port

I tried to manually kill the pod, but then hal was lost because obviously the new pod had a different name so I deleted the Halkyon component, and re-created it:

➜  playgrounds hal component create dekorate-and-vertx
? Runtime vert.x
? Version 3.8.2
? Expose microservice Yes
? Port 8080
? Use code generator No
? Local component directory dekorate-and-vertx
? Env variable in the 'name=value' format, simply press enter when finished
❯ Selected Name: dekorate-and-vertx
 ✓  Successfully created 'dekorate-and-vertx' component
➜  playgrounds hal component push -c dekorate-and-vertx -b
Local changes detected for 'dekorate-and-vertx' component: about to push packaged binary to remote cluster
 ✓  Uploading /Users/jponge/Code/playgrounds/dekorate-and-vertx/target/dekorate-and-vertx-0.0.0-SNAPSHOT-all.jar
 ✓  Restarting app
 ✓  Successfully pushed 'dekorate-and-vertx' component to remote cluster

But this still gives a ClusterIP service:

➜  playgrounds hal component push -c dekorate-and-vertx -b
Local changes detected for 'dekorate-and-vertx' component: about to push packaged binary to remote cluster
 ✓  Uploading /Users/jponge/Code/playgrounds/dekorate-and-vertx/target/dekorate-and-vertx-0.0.0-SNAPSHOT-all.jar
 ✓  Restarting app
 ✓  Successfully pushed 'dekorate-and-vertx' component to remote cluster
➜  playgrounds kubectl get components
NAME                 RUNTIME   VERSION   AGE   MODE   STATUS   MESSAGE                                                             REVISION
dekorate-and-vertx   vert.x    3.8.2     35s   dev    Ready    Ready: 'PodName' changed to 'dekorate-and-vertx-85fcfff4d6-8t4lx'   e10d5df6c0725078778ec3b76ff92c06f7d3900b
➜  playgrounds kubectl get services
NAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
dekorate-and-vertx   ClusterIP   10.100.169.9   <none>        8080/TCP   43s
kubernetes           ClusterIP   10.96.0.1      <none>        443/TCP    5d11h
➜  playgrounds minikube service --url dekorate-and-vertx
😿  service default/dekorate-and-vertx has no node port

I then ran minikube tunnel and did the following:

➜  dekorate-and-vertx kubectl get services
NAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
dekorate-and-vertx   ClusterIP   10.100.169.9   <none>        8080/TCP   12m
kubernetes           ClusterIP   10.96.0.1      <none>        443/TCP    5d11h
➜  dekorate-and-vertx http 10.100.169.9:8080

http: error: ConnectionError: HTTPConnectionPool(host='10.100.169.9', port=8080): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10dee07d0>: Failed to establish a new connection: [Errno 61] Connection refused')) while doing GET request to URL: http://10.100.169.9:8080/

Am I missing anything?

Thanks!

from hal.

jponge avatar jponge commented on August 25, 2024

Also:

➜  dekorate-and-vertx kubectl describe components dekorate-and-vertx
Name:         dekorate-and-vertx
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  halkyon.io/v1beta1
Kind:         Component
Metadata:
  Creation Timestamp:  2019-10-19T19:40:36Z
  Generation:          3
  Resource Version:    68268
  Self Link:           /apis/halkyon.io/v1beta1/namespaces/default/components/dekorate-and-vertx
  UID:                 a822291b-0c5c-4acc-b282-1d42dbe9402a
Spec:
  Build Config:
    Ref:
    URL:
  Deployment Mode:  dev
  Expose Service:   true
  Port:             8080
  Revision:         e10d5df6c0725078778ec3b76ff92c06f7d3900b
  Runtime:          vert.x
  Storage:
  Version:  3.8.2
Status:
  Message:   Ready: 'PodName' changed to 'dekorate-and-vertx-85fcfff4d6-8t4lx'
  Phase:     Ready
  Pod Name:  dekorate-and-vertx-85fcfff4d6-8t4lx
Events:      <none>

from hal.

jponge avatar jponge commented on August 25, 2024

I also did copy / run without hal:

➜  dekorate-and-vertx kubectl cp target/dekorate-and-vertx-0.0.0-SNAPSHOT-all.jar dekorate-and-vertx-85fcfff4d6-8t4lx:/deployments/app.jar
➜  dekorate-and-vertx kubectl exec dekorate-and-vertx-85fcfff4d6-8t4lx /var/lib/supervisord/bin/supervisord ctl start run

from hal.

metacosm avatar metacosm commented on August 25, 2024

I've upgraded to the latest hal on the master branch.

First thing hal component create is a bit confusing since it also offers scaffolding.

Yes, this needs to be cleaned-up as this is confusing. See: #40 (comment)

I eventually figured out how to use it, but I had to go to the parent folder of my project:

This also needs to be cleared-up. Indeed, hal works in a similar way to how maven does, i.e. you execute it in the parent directory where components are akin to modules. The physical layout needs to be clarified and I feel we're lacking a unifying application concept to tie everything together: an application would be the set of components and capabilities linked together and be organized as a directory containing one child directory but component. That seems quite intuitive to me but maybe I'm wrong… What do you think?

I then did a push which looked ok on the surface:
It took me a while to figure out that this had pushed the source code but that nothing had actually been built / deployed.

Non-binary push (i.e. the default push) currently only works with Spring Boot because it requires a specific image. We need to either make this image available to other runtimes (though, right now, it bundles many Spring Boot dependencies to accelerate builds) or publish what are the runtime images expectations. I've had a similar discussion with @Ladicek on Zulip on this very subject already :)

I eventually discovered the -b flag:

👍

But the service has no external IP:

➜  dekorate-and-vertx kubectl get components
NAME                 RUNTIME   VERSION   AGE   MODE   STATUS   MESSAGE                                                             REVISION
dekorate-and-vertx   vert.x    3.8.2     10m   dev    Ready    Ready: 'PodName' changed to 'dekorate-and-vertx-85fcfff4d6-5nc7t'   e10d5df6c0725078778ec3b76ff92c06f7d3900b
➜  dekorate-and-vertx kubectl get services
NAME                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
dekorate-and-vertx   ClusterIP   10.104.157.62   <none>        8080/TCP   10m
kubernetes           ClusterIP   10.96.0.1       <none>        443/TCP    5d11h
➜  dekorate-and-vertx minikube service --url dekorate-and-vertx
😿  service default/dekorate-and-vertx has no node port

Hmm, that is weird…

I tried to manually kill the pod, but then hal was lost because obviously the new pod had a different name so I deleted the Halkyon component, and re-created it:

Halkyon should be able to properly recover from a manual kill of the pod. Another thing to look into… :(

from hal.

metacosm avatar metacosm commented on August 25, 2024

Also:

➜  dekorate-and-vertx kubectl describe components dekorate-and-vertx
Name:         dekorate-and-vertx
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  halkyon.io/v1beta1
Kind:         Component
Metadata:
  Creation Timestamp:  2019-10-19T19:40:36Z
  Generation:          3
  Resource Version:    68268
  Self Link:           /apis/halkyon.io/v1beta1/namespaces/default/components/dekorate-and-vertx
  UID:                 a822291b-0c5c-4acc-b282-1d42dbe9402a
Spec:
  Build Config:
    Ref:
    URL:
  Deployment Mode:  dev
  Expose Service:   true
  Port:             8080
  Revision:         e10d5df6c0725078778ec3b76ff92c06f7d3900b
  Runtime:          vert.x
  Storage:
  Version:  3.8.2
Status:
  Message:   Ready: 'PodName' changed to 'dekorate-and-vertx-85fcfff4d6-8t4lx'
  Phase:     Ready
  Pod Name:  dekorate-and-vertx-85fcfff4d6-8t4lx
Events:      <none>

That looks OK as far as I can tell. Is you service really running on port 8080?

from hal.

jponge avatar jponge commented on August 25, 2024

from hal.

jponge avatar jponge commented on August 25, 2024

from hal.

metacosm avatar metacosm commented on August 25, 2024

By the way, regarding the runtime issue: halkyonio/operator#169

from hal.

jponge avatar jponge commented on August 25, 2024

Making progress, see dekorateio/dekorate#389 on a related problem

from hal.

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.