Skip to content
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

Tickets/dm 17656 #508

Open
wants to merge 104 commits into
base: u/jgates/loader
Choose a base branch
from
Open

Tickets/dm 17656 #508

wants to merge 104 commits into from

Conversation

jgates108
Copy link
Contributor

No description provided.

Copy link
Contributor

@iagaponenko iagaponenko left a comment

Choose a reason for hiding this comment

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

I have made the first sweep through classes "appClientNum, appClientMaster, appWorker, BufferUdp, CentralFollower, CentralClient, CentralWorker, ClientServer, WorkerServer, WWorkerList" and files in folder "admin/tools/docker/index". I have left comments where I could understand the code. My main problem was that this is not the usual "diff" ticket. It appears as a completely new development. So, it makes it difficult to judge how the claimed goal of the ticket has been achieved with this code.
My second big complain with the code is the naming convention behind many classes and some methods. The naming convention is way to abstract/generic. It makes it difficult to understand roles and behaviors of classes and methods.
Ideally I would like to have an in-person conversation to better understand the overall design of this application.
I approve it, conditionally, provided that my comments and suggestions will be considered.

@@ -0,0 +1,31 @@
#! /bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on my understanding on what the script does it's supposed to be launched from (cd <path>) some specific directory (which is the same one where the script runs. This opens numerous possibilities for making mistakes. I would recommend passing a target folder as a parameter to the script, so that it could be run like:

% qserv/admin/tools/docker/loader/container/buildContainers.bash <qserv-base-dir>

You may get and evaluate a value of the parameter with:

QSERV_BASE_DIR="$1"
if [ -z "$QSERV_BASE_DIR" ]; then
    echo "usage: <path>"
    exit 1
fi
cd $QSERV_BASE_DIR

@@ -0,0 +1,13 @@
#
Copy link
Contributor

Choose a reason for hiding this comment

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

What's a point in building a separate binary container for each tool (clientNum, appClientNum, appClientNumScreen, etc.)? You may as well package all these binaries into a single container. Then you may launch the container by specifying an application you want to run:

% docker run -it --rm qserv/index:dev clientNum.bash <parameters>

I think you may just add the name of a script/binary as an extra argument in the Kubernetes YAML file:

args: ["clientNum.bash", "10000000", "1", "client-k8s-a1.cnf"]

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 made the yaml scripts easier to write and get working (which was not easy) and an actual instance of the system would not have the client apps, as they are only for testing. It would make sense to eventually trim down the containers so they only contain what they really need.
Currently, the containers all share the same qserv/indexbase:dev. The differences for the individual containers really comes down the entrypoint designations and bash scripts, which is small. There could be significant differences between master and worker containers in the future.

screen -dm /home/qserv/dev/qserv/admin/tools/docker/index/container/dev/clientNum/appClientNum $1 $2 $3


tail -f /dev/null
Copy link
Contributor

Choose a reason for hiding this comment

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

The NEWLINE symbol is missing in the end of the file

@@ -0,0 +1,31 @@
#! /bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

I would also recommend adding:

set -e

to this and all other shell scripts. This will terminate the on errors and prevent unreliable results. See more on tis at:
https://stackoverflow.com/questions/6930295/set-e-and-short-tests


screen -dm /home/qserv/dev/qserv/admin/tools/docker/index/container/dev/worker/appWorker.bash

tail -f /dev/null
Copy link
Contributor

Choose a reason for hiding this comment

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

The NEWLINE symbol is missing in the end of the file


int getTcpPort() const override { return _tcpPort; }

uint32_t getOurId() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this method is defined as inline?

@@ -0,0 +1,1146 @@
// -*- LSST-C++ -*-
Copy link
Contributor

Choose a reason for hiding this comment

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

This file is huge. I happen to review it many months ago. And it's not clear from this PR what were exact changes to the class in a context of this development.

#include "loader/CentralWorker.h"

// system headers
#include <boost/asio.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

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

The third party header. And it must be included in the double quotes.

#include <iostream>

// third party headers
#include <boost/asio.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

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

The non-system headers should not be included with the angle brackets.

// system headers
#include <cstdlib>
#include <iostream>
#include <boost/bind.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

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

These two are the third party headers, and they also need to be included within the doube quotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants