Click here to load reader

[name] Computer Sciences Department University of Wisconsin-Madison [email] Building and Modifying Condor Nick LeRoy Computer Sciences Department

  • View

  • Download

Embed Size (px)

Text of [name] Computer Sciences Department University of Wisconsin-Madison [email] Building and...

Building and Modifying CondorBuilding and
If you have any questions, stop me along the way
There should hopefully be time for discussions after the talk
Feel free to talk to me, or any of the Condor developers, any time during the conference
Todd will give the last part of the talk
Windows specifics
Bare minimum 2G
Temporary space is required for building externals, automatically cleaned up
In other cases, they can be downloaded as binaries
Or, downloaded as source and built by hand
GNU tar (1.13 or higher)
GNU Compiler Collection (gcc >= 2.95.3)
Getting it
Download from the same place that you download the rest of Condor
In the form of a gzip-ed “tarball”
Unpack the tarball
If you don’t know how to do this, try:
rm condor_src-7.1.0-all-all.tar.gz
config and imake
The rest of the world wisely abandoned it years ago …
You can probably ignore these
Adds requirement: GNU cpp <= 4.1.3
The license under which we’ve released Condor
$ cd src
Didn’t work?
Most common problem is that you’re trying to build on a system that we haven’t ported the Standard Universe to
Solution: Disable the standard universe and try again
$ ./configure --disable-full-port \
Bags are getting pretty big these days
Globus, ClassAds, PCRE, zlib, Kerberos
Externals and versions by configure
To use system packages:
We’re working on making this selective
Externals tree selected by:
Directories with most of the source code
In the future, we’ll rename them and get rid of the condor_ prefix
Also: h
Make sure that the cpp you use isn’t >= 4.2
$ export CXXCPP=/usr/bin/cpp-4.1
Minimal configuration
To save disk & time, make use of –without-xxx or –disable-xxx options you don’t care about
Use ./configure –help to get a list of them
Packages listed as “hard requirement” can’t be turned off
There are some interdependencies
configure: error: Condor will not compile with gcc version 4.2.1
Some Problems & Solutions
Unknown glibc version
checking glibc... ERROR
configure: error: Condor does NOT know what glibc external to use with glibc-2.6.1
Edit (yeah, with vi or emacs)
Around line 2500, add a block for your glibc version (cut & paste from nearby):
"2.6.1" ) # OpenSUSE 10.3 uses glibc 2.6.1
Go get a beverage – this could take quite a while
$ ./configure –without-xxxx
If this is a “hard requirement” or you rely on this feature:
Look in the above log and correct the problem
../../imake/imake: Exit code 1.
Standard Universe features haven’t been ported to this compiler / platform yet.
$ ./configure --disable-full-port
make[1]: Leaving directory `/home/build/condor-7.1.0/src/condor_examples‘
$ make release
$ make public
We’ll create a test installation of our Condor build
We built condor in /home/condor-7.1.0
We’ll make our test directory a subdirectory of that
Do a basic Condor install of the Condor from release_dir, just like you would any other Condor install
Or …
$ ln –s ../release_dir/* .
$ cp etc/examples/condor_config.generic etc/condor_config
$ export CONDOR_CONFIG=$CONDOR/etc/condor_config
Run condor_status –any
Run condor_status to verify that the Startd’s machine is correct
Make sure that you wait a bit for the Startd to publish it’s ad(s)
Look through the logs
Submit a simple “hello world” test job, verify that it runs as expected
$ cd condor_tests
Most of the directory names are pretty clear
We’re in the process of cleaning up, moving things around, and renaming, so be prepared for changes over time
GIT is finally giving us this freedom
Quite a few have version numbers in the name that make little or no sense to the outside world (condor_startd.V6, …)
This will get cleaned up, too
Master, Quill, Startd, Shadow, Starter, Collector
Submit, Q,
tools, etc.
“h”, includes
General purpose:
POSIX and stdio library wrappers
C++ Standard library replacements
Designed to be portable
dprintf(D_ALWAYS, “Two + two is %d\n”, 2+2);
OR together for multiple levels, so dprintf(D_COMMAND|D_SECURITY, <…>);
Useful debug levels
Prefer MyString buffer to char buffer[1024]
automatically allocates and resizes memory
Notable methods / operators:
sprintf() and sprintf_cat()
Value() and GetCStr() – read-only access
+= is overloaded to append a lot of types to the string
perl-like chomp() and trim() to get rid of whitespace
readLine() that can slurp in data from a FILE* and ostreams
replacement for strtok()
NOT a ClassAd!
You MUST free() this buffer!
Others: param_<type>(<name>)
Decodes to the specified type, and free()’s the buffer
Does NOT handle expressions!
Data is encoded with CEDAR
Condor External DAta Representation
CEDAR is all-singing, all-dancing
The layering of the Condor socket objects is not obvious
Stream (base class, in stream.{h,C} )
CEDAR streaming
Adds connection / session management
TCP-specific “Sock”
UDP-specific “Sock”
Daemon Client
Series of classes with knowledge of how to communicate with specific daemons
Master, Collector, Startd, etc.
C++ API to access the ClassAds that Condor uses internally
“Old” ClassAds
Lookup() versus Eval()
Eval() will return 9
Can generally avoid this and use Eval<Type>
Insert() and Assign() to update the ad
sPrint(), fPrint(), and dPrint() to serialize
Condor Daemons
The code for most Condor daemons are in directories named after the daemon:
Startd is in condor_startd.V6 …
condor_starter.V5 and condor_shadow.V6
Usually a singleton object
Event-driven loop around select()
Timers, Pipes, Signals, Reaper, Socket, CEDAR “Commands”
daemonCore->Register_Command(128, "SAY_HELLO", (CommandHandler)&say_hello, "say_hello", NULL, READ, D_FULLDEBUG );
Text description of the command
"CommandHandler", which is really a function pointer
Text description of the handler
The service class to use -- since this is a C handler, we don't need one.
What Permission level we need to be to call this function (i.e. HOSTALLOW_READ, HOSTALLOW_ADMINISTRATOR, etc)
What dprintf() level to use
You can:
call ASSERT()
call dprintf()
Our build system has no knowledge of dependencies
If you modify an include file, make sure that everything that depends on it gets rebuilt
$ make clean && make
More on Dependencies
Objects from some directories need to get “repackaged” with the C++ library
(Even) More on Dependencies
If you’re working on a daemon and make a library change
Example daemon: Startd in the condor_startd.V6 directory
Example library: condor_daemon_client
$ (cd ../condor_daemon_client && make clean && make)
$ (cd ../condor_c++_util && make clean && make)
$ make clean && make release
Add the file to the appropriate section of the Imakefile
No, I’m not going to explain our Imakefile syntax here
$ ../condor_imake
$ make
Testing & Debugging
OK, You’ve built a modified Startd, how do I test / debug it?
$ ./condor_startd -t –f
-f to run it in the foreground
CTRL-C to kill it
Segfaults can sometimes be caused by object version mismatches
You added a field to a class in C++ Util, but didn’t rebuild the Startd that uses the class
With the the use of the –t and -f flags, you can debug like any other program
Adding dprintf()’s
Maybe re-run the test suite (as described previously)
Where can I get access to the latest source code?
Currently, all that’s available to the general public is the source tarballs
We hope to make “GIT balls” available in the near future
You’d have access to log information, etc.
We won’t provide access to our live GIT repository
We’re worried about exposing security problems before fixed binaries are publicly available
Before Contributing to Condor
Before we can accept any code from you, you must sign our Contributor License Agreement (CLA)
Based on the Apache CLA
You give us the right to do anything with your code, but you keep the rights to do whatever you want with it, too.
Talk to us before large contributions
We may be already working on the same thing you are
We may have a “bigger” plan for solving the problem
We recommend that you subscribe to the condor-devel mailing list
Discuss your idea / patch with the other Condor developers, get feedback, etc.
Send patch to condor-devel list
Send it to condor-admin

Search related