Skip to content

Use docker to build cassandra jar file #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2018

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Feb 22, 2018

Test image: aledbf/cassandra:v15

This PR also replaces the java code with a go shared library.

fixes #190
fixes #147

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 22, 2018
@aledbf aledbf changed the title Use docker to build cassandra jar file WIP: Use docker to build cassandra jar file Feb 22, 2018
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 22, 2018
@ahmetb
Copy link
Member

ahmetb commented Feb 22, 2018

It'd be great if you can find someone else who knows cassandra a little bit better than I do to review this, perhaps someone from sig-storage can help.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 24, 2018
@aledbf aledbf changed the title WIP: Use docker to build cassandra jar file Use docker to build cassandra jar file Feb 24, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 24, 2018
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 25, 2018
@ahmetb
Copy link
Member

ahmetb commented Mar 5, 2018

If this is good to go, do you mind finding a reviewer (perhaps the original developers of Cassandra example, or we can mention [@]kubernetes/sig-storage-pr-reviews).

@ahmetb
Copy link
Member

ahmetb commented Apr 12, 2018

Sorry I was late to review this. I don't understand the domain much but the code looks good + you're the owner for this example now.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 12, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmetb, aledbf

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 12, 2018
@k8s-ci-robot k8s-ci-robot merged commit 93e3760 into kubernetes:master Apr 12, 2018
@ahmetb
Copy link
Member

ahmetb commented Apr 12, 2018

@aledbf Let me know if the image needs re-pushing.

@aledbf
Copy link
Member Author

aledbf commented Apr 12, 2018

@ahmetb yes, you need to publish the image.

@ahmetb
Copy link
Member

ahmetb commented Apr 12, 2018

@aledbf this fails to build:

/build.sh: line 33: CASSANDRA_VERSION: unbound variable
The command '/bin/sh -c clean-install bash     && /build.sh     && rm /build.sh' returned a non-zero code: 1
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: exit status 1

@ahmetb
Copy link
Member

ahmetb commented Apr 12, 2018

My bad I probably should've used the makefile to build/push.

@ahmetb
Copy link
Member

ahmetb commented Apr 12, 2018

I pushed gcr.io/google-samples/cassandra:v14 (+-dev) please try out and update the documentation.

wallrj added a commit to wallrj/navigator that referenced this pull request Apr 12, 2018
wallrj added a commit to wallrj/navigator that referenced this pull request Apr 14, 2018
* from before kubernetes/examples#201,
* because that introduced a new Go / CGo shared library dependency which we don't want to have to bundle into our pilot image.
@wallrj
Copy link

wallrj commented Apr 24, 2018

This PR also replaces the java code with a go shared library.

Hi @aledbf. What was the motivation for introducing the Go shared library?

We were using the pure Java Kubernetes seed provider, but the addition of a Go shared library makes it more difficult for us to re-use this in Navigator.
See: jetstack/navigator#332 and jetstack/navigator#336

Not complaining, just grumbling 😉

@aledbf
Copy link
Member Author

aledbf commented Apr 24, 2018

but the addition of a Go shared library makes it more difficult for us to re-use this in Navigator.

Why?

Hi @aledbf. What was the motivation for introducing the Go shared library?

Because doing this in go is cleaner than the previous code and also we can use client-go

@wallrj
Copy link

wallrj commented Apr 24, 2018

but the addition of a Go shared library makes it more difficult for us to re-use this in Navigator.

Why?

We're trying to use the Kubernetes Seed provider with the Cassandra images hosted on Dockerhub, not the images built for this demo.
So before, we had only to download the Jar artefact from the repository and add it to the Pod from an init container.
Now we also have to compile and install the Go shared object.

Hi @aledbf. What was the motivation for introducing the Go shared library?

Because doing this in go is cleaner than the previous code and also we can use client-go

Ok. Thanks for clarifying.

But note @chrislovecnm 's original plan was that this seed provider code might eventually be moved into the Cassandra code base:

Once stable these components are stable recommended that this code gets moved into the Apache Cassandra code base.
-- kubernetes/kubernetes#24286

With that in mind, I'd have thought it more likely to be accepted as a pure java implementation, perhaps using the official Java client for Kubernetes: https://github.com/kubernetes-client/java

Have you any plans to move the Kubernetes Seed Provider to a dedicated repository?
It is useful outside of this example.

@madireddyr madireddyr mentioned this pull request Jun 14, 2018
@madireddyr
Copy link

@aledbf : when we tried gcr.io/google-samples/cassandra:v14 & 13 : we got below error
INFO 19:45:59 Unable to load cassandra-topology.properties; compatibility mode disabled
Exception (org.apache.cassandra.exceptions.ConfigurationException) encountered during startup: io.k8s.cassandra.KubernetesSeedProvider
Fatal configuration error; unable to start server. See log for stacktrace.
org.apache.cassandra.exceptions.ConfigurationException: io.k8s.cassandra.KubernetesSeedProvider
Fatal configuration error; unable to start server. See log for stacktrace.
at org.apache.cassandra.config.DatabaseDescriptor.applySeedProvider(DatabaseDescriptor.java:895)
at org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:324)
at org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:142)
at org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:647)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:582)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:691)
ERROR 19:45:59 Exception encountered during startup
org.apache.cassandra.exceptions.ConfigurationException: io.k8s.cassandra.KubernetesSeedProvider
Fatal configuration error; unable to start server. See log for stacktrace.
at org.apache.cassandra.config.DatabaseDescriptor.applySeedProvider(DatabaseDescriptor.java:895) ~[apache-cassandra-3.11.2.jar:3.11.2]
at org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:324) ~[apache-cassandra-3.11.2.jar:3.11.2]
at org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:142) ~[apache-cassandra-3.11.2.jar:3.11.2]
at org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:647) [apache-cassandra-3.11.2.jar:3.11.2]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:582) [apache-cassandra-3.11.2.jar:3.11.2]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:691) [apache-cassandra-3.11.2.jar:3.11.2]

i tried above example with aledbf/cassandra:v15 and it worked . not sure whats the difference between
gcr.io/google-samples/cassandra:v14 & aledbf/cassandra:v15

i see aledbf/cassandra:v15 got merged could you point me committed image(seems aledbf/cassandra:v15 is a test image)

@mkobit
Copy link

mkobit commented Nov 27, 2018

@madireddyr It doesn't look like the gcr.io/google-samples/cassandra:v14 tag was updated with these changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
6 participants