[ 
https://issues.apache.org/jira/browse/CASSANDRA-18035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17649717#comment-17649717
 ] 

Stefan Miklosovic edited comment on CASSANDRA-18035 at 12/20/22 12:31 PM:
--------------------------------------------------------------------------

I found some time to test this already, couldnt resist! I put some comments to 
PR as well.

All looks good, the only thing which might be improved is this, check the 
output. What I would expect that when docker-start target is finished, I can 
truly execute nodetool's commands against that. I am not sure how the start of 
the container is evaluated but I would do it in such a way that unless nodetool 
status does not return 0 exit code, it will be still "starting".

Also, there are language constructs used when we are not compatible with POSIX 
sh. I am not sure what agreement we have here. I _think_ that scripts which are 
not used in production may be based on bash(isms). Nevertheless there are still 
some micro-improvements in these script to be made. 

 
{code:java}
✔ ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:12 $ ant docker-start
Buildfile: /home/fermat/dev/cassandra/cassandra-instaclustr/cassandra/build.xml

docker-start:
     [exec] 9c68a50bcc260c1c1ce8af5cfb9ce9f2e634cadaeda50688c52b9206ba8ab4b3
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] cassandra-test container started with id 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0
     [exec] 
     [exec] Use 'docker-exec -it cassandra-test <CMD>' to execute commands on 
this container.
     [exec] ie. docker exec -it cassandra-test nodetool status
     [exec] ie. docker exec -it cassandra-test cqlsh

BUILD SUCCESSFUL
Total time: 31 seconds
✔ ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:12 $ docker exec -it cassandra-test nodetool status

Error: No nodes present in the cluster. Has this node finished starting up?
✘-1 ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:12 $ docker exec -it cassandra-test nodetool status

Error: No nodes present in the cluster. Has this node finished starting up?
✘-1 ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:13 $ docker exec -it cassandra-test nodetool status

Error: No nodes present in the cluster. Has this node finished starting up?
✘-1 ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:13 $ docker exec -it cassandra-test nodetool status

Error: No nodes present in the cluster. Has this node finished starting up?
✘-1 ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:13 $ docker exec -it cassandra-test nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load        Tokens  Owns (effective)  Host ID                   
            Rack 
UN  172.20.0.2  130.46 KiB  16      100.0%            
e966c776-351b-422e-aa05-4c21091eabd2  rack1

{code}


was (Author: smiklosovic):
I found some time to test this already, couldnt resist! I put some comments to 
PR as well.

All looks good, the only thing which might be improved is this, check the 
output. What I would expect that when docker-start target is finished, I can 
truly execute nodetool's commands against that. I am not sure how the start of 
the container is evaluated but I would do it in such a way that unless nodetool 
status does not return 0 exit code, it will be still "starting".
{code:java}
✔ ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:12 $ ant docker-start
Buildfile: /home/fermat/dev/cassandra/cassandra-instaclustr/cassandra/build.xml

docker-start:
     [exec] 9c68a50bcc260c1c1ce8af5cfb9ce9f2e634cadaeda50688c52b9206ba8ab4b3
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] Waiting for cassandra-test container 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0 to start.
     [exec] cassandra-test container started with id 
b434586cdf88600cbc4d231fb6baf4131aa96acb536969b9b7c5f2bb7938b8e0
     [exec] 
     [exec] Use 'docker-exec -it cassandra-test <CMD>' to execute commands on 
this container.
     [exec] ie. docker exec -it cassandra-test nodetool status
     [exec] ie. docker exec -it cassandra-test cqlsh

BUILD SUCCESSFUL
Total time: 31 seconds
✔ ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:12 $ docker exec -it cassandra-test nodetool status

Error: No nodes present in the cluster. Has this node finished starting up?
✘-1 ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:12 $ docker exec -it cassandra-test nodetool status

Error: No nodes present in the cluster. Has this node finished starting up?
✘-1 ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:13 $ docker exec -it cassandra-test nodetool status

Error: No nodes present in the cluster. Has this node finished starting up?
✘-1 ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:13 $ docker exec -it cassandra-test nodetool status

Error: No nodes present in the cluster. Has this node finished starting up?
✘-1 ~/dev/cassandra/cassandra-instaclustr/cassandra [CASSANDRA-18035 L|● 1] 
13:13 $ docker exec -it cassandra-test nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load        Tokens  Owns (effective)  Host ID                   
            Rack 
UN  172.20.0.2  130.46 KiB  16      100.0%            
e966c776-351b-422e-aa05-4c21091eabd2  rack1

{code}

> Add quick start development guide and docker ant targets
> --------------------------------------------------------
>
>                 Key: CASSANDRA-18035
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18035
>             Project: Cassandra
>          Issue Type: Task
>          Components: Documentation
>            Reporter: Paulo Motta
>            Assignee: Paulo Motta
>            Priority: Normal
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> I propose adding a new {{QUICKSTART.md}} guide that provides instructions to 
> beginner contributors on how to:
> a) Setup a development environment and IDE from scratch on WSL/Ubuntu/Debian 
> environments
> b) Run a simple unit test from the IDE
> c) Create a simple patch that prints "Hello World" during Cassandra 
> initialization
> d) Test the patch on a local docker instance
> A new {{docker/}} directory is added along with the guide with the following 
> utilities:
> a) Dockerfile: unoptimized vanilla docker image manifest suitable only for 
> local dev testing.
> b) build.sh: build a cassandra artifact and cassandra-test image.
> c) start.sh: start local cassandra-test container.
> d) stop.sh: stop local-cassandra test container.
> A couple of follow-up improvements that come to mind:
>  - Add ant targets to build/start/stop cassandra-test container.
>  - Add OSX instructions.
>  - More IDE setup instructions (ie. Eclipse/VScode).
>  - A more involved Hello World example, perhaps creating a dummy VirtualTable 
> with unit/dtests.
>  - Update Dockerfile to point to build/ instead of creating an artifact.
> A DEV mailing list message was sent to gather community feedback on this 
> proposal: https://lists.apache.org/thread/gmb0q5yb2bzbs0cjw7mlcz1vwk2l23g2



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to