Skip to content

Conversation

@pzmrzy
Copy link
Contributor

@pzmrzy pzmrzy commented Sep 7, 2018

Proposed Changes

  • Add a hello world example in Kotlin

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 7, 2018
@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 7, 2018
@pzmrzy
Copy link
Contributor Author

pzmrzy commented Sep 7, 2018

/assign @mattmoor

@mattmoor
Copy link
Member

/ok-to-test

@knative-prow-robot knative-prow-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 21, 2018
@mattmoor mattmoor assigned grantr and unassigned mattmoor and mdemirhan Sep 21, 2018
Copy link
Contributor

@grantr grantr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pzmrzy!

/lgtm

Sample code looks good to me, and it worked when I ran through it.

/assign @samodell
for approval.

}
```

3. Create a new file, `build.gradle` and copy the following setting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mention the switch back to the root directory for this and later files?


4. To find the IP address for your service, use
`kubectl get svc knative-ingressgateway -n istio-system` to get the ingress IP for your
cluster. If your cluster is new, it may take sometime for the service to get asssigned
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: assigned

```shell
kubectl get svc knative-ingressgateway -n istio-system

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output of the command should be in a separate shell block so users can copy the entire command block without interpreting its contents.

5. To find the URL for your service, use
```
kubectl get ksvc helloworld-kotlin -o=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
NAME DOMAIN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate shell block


```shell
curl -H "Host: helloworld-kotlin.default.example.com" http://{IP_ADDRESS}
Hello World: Kotlin Sample v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate shell block

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2018
@grantr
Copy link
Contributor

grantr commented Sep 21, 2018

/unassign @grantr

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2018
@grantr
Copy link
Contributor

grantr commented Sep 27, 2018

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 27, 2018

CMD ["gradle"]

ENV GRADLE_HOME /opt/gradle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pzmrzy is there a reason for not using gradle official image(s) ? (as it really does the same thing https://github.com/keeganwitt/docker-gradle/blob/bd6b0605196488734d8d61d6a00a4ca96846d2e7/jdk8/Dockerfile)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vdemeester I think no, I did't find this before, I just search on github for a gradle docker image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pzmrzy I guess we can do a follow-up to use an official image then 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vdemeester Just update the image and test again

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pzmrzy Can we use the official gradle image for this? Lines 1-34 can be replaced by:

FROM gradle

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 1, 2018
@imikushin
Copy link

@pzmrzy Let's see what we can do to get this in ;)

Can you resolve the merge conflicts first?

/assign

Copy link

@imikushin imikushin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 20, 2018
@imikushin
Copy link

@samodell Can you approve?

@imikushin
Copy link

@RichieEscarez Can you take another look at this? It's been a while

@samodell
Copy link
Contributor

Hey @imikushin -- we recently merged in some updates to the Hello World samples; they've been rewritten so they aren't hard coded to listen on port 8080. See this issue for more information: #456 It looks to me like your sample is hard-coded to listen on port 8080? (I'm definitely not a Kotlin expert, so let me know if that's not the case.) The "Hello World" sections were also slightly revamped; see the changes on lines 4-5 in the README of this PR for an example: https://github.com/knative/docs/pull/462/files#diff-99942f6b9d4f507ea57838988d5f8cbc
I'll also do a quick review of the writing here for readability later today. Once all that's done, we'll get this merged in! Thanks for your patience.

revisionTemplate:
spec:
container:
image: docker.io/{username}/helloworld-kotlin

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker.io/ should probably be omitted:
I saw image pull errors with docker.io/imikushin/helloworld-kotlin, but imikushin/helloworld-kotlin worked just fine 🤷‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine for me with docker.io, other samples also have this.

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 25, 2018
@pzmrzy
Copy link
Contributor Author

pzmrzy commented Oct 25, 2018

@samodell Just updated!

Copy link
Contributor

@samodell samodell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more changes.

@@ -0,0 +1,213 @@
# Hello World - Kotlin sample

A simple web app written in Kotlin using Ktor that you can use for testing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: add a link to more info about the Ktor framework

an external IP address.

```shell
kubectl get svc knative-ingressgateway -n istio-system
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We ended up reverting the changes that exposed the short names (svc, for example) because they're not in the 0.1 release. To fix, replace "svc" and "ksvc" with "services.serving.knative.dev" and delete the Note about the short names, further down.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment, just updated.

curl -H "Host: helloworld-kotlin.default.example.com" http://{IP_ADDRESS}
```
```shell
Hello World: Kotlin Sample v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other changes made above mean this output should now be "Hello Kotlin Sample v1".

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: imikushin, pzmrzy, samodell, vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@samodell
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2018
@knative-prow-robot knative-prow-robot merged commit c9430ee into knative:master Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/needs-eng-input Engineering input is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants