DCloudResource::DCloudResource( const char *resource_name, const char *username, const char *password ) : BaseResource( resource_name ) { // although no one will use resource_name, we still keep it for base class constructor m_username = strdup( username ); m_password = strdup( password ); gahp = NULL; status_gahp = NULL; char * gahp_path = param( "DELTACLOUD_GAHP" ); if ( gahp_path == NULL ) { dprintf(D_ALWAYS, "DELTACLOUD_GAHP not defined! \n"); return; } gahp = new GahpClient( DCLOUD_RESOURCE_NAME, gahp_path ); gahp->setNotificationTimerId( pingTimerId ); gahp->setMode( GahpClient::normal ); gahp->setTimeout( DCloudJob::gahpCallTimeout ); status_gahp = new GahpClient( DCLOUD_RESOURCE_NAME, gahp_path ); StartBatchStatusTimer(); status_gahp->setNotificationTimerId( BatchPollTid() ); status_gahp->setMode( GahpClient::normal ); status_gahp->setTimeout( DCloudJob::gahpCallTimeout ); free(gahp_path); }
bool CreamResource::Init() { if ( initialized ) { return true; } // TODO This assumes that at least one CreamJob has already // initialized the gahp server. Need a better solution. std::string gahp_name; formatstr( gahp_name, "CREAM/%s/%s", proxySubject, proxyFirstFQAN ); gahp = new GahpClient( gahp_name.c_str() ); gahp->setNotificationTimerId( pingTimerId ); gahp->setMode( GahpClient::normal ); gahp->setTimeout( gahpCallTimeout ); deleg_gahp = new GahpClient( gahp_name.c_str() ); deleg_gahp->setNotificationTimerId( delegationTimerId ); deleg_gahp->setMode( GahpClient::normal ); deleg_gahp->setTimeout( gahpCallTimeout ); status_gahp = new GahpClient( gahp_name.c_str() ); StartBatchStatusTimer(); status_gahp->setNotificationTimerId( BatchPollTid() ); status_gahp->setMode( GahpClient::normal ); status_gahp->setTimeout( gahpCallTimeout ); m_leaseGahp = new GahpClient( gahp_name.c_str() ); m_leaseGahp->setNotificationTimerId( updateLeasesTimerId ); m_leaseGahp->setMode( GahpClient::normal ); m_leaseGahp->setTimeout( gahpCallTimeout ); char* pool_name = param( "COLLECTOR_HOST" ); if ( pool_name ) { StringList collectors( pool_name ); free( pool_name ); pool_name = collectors.print_to_string(); } if ( !pool_name ) { pool_name = strdup( "NoPool" ); } formatstr( m_leaseId, "Condor#%s#%s#%s", myUserName, ScheddName, pool_name ); free( pool_name ); initialized = true; Reconfig(); return true; }
EC2Resource::EC2Resource( const char *resource_name, const char * public_key_file, const char * private_key_file ) : BaseResource( resource_name ), jobsByInstanceID( hashFunction ), spotJobsByRequestID( hashFunction ), m_hadAuthFailure( false ), m_checkSpotNext( false ) { // although no one will use resource_name, we still keep it for base class constructor m_public_key_file = strdup(public_key_file); m_private_key_file = strdup(private_key_file); gahp = NULL; char * gahp_path = param( "EC2_GAHP" ); if ( gahp_path == NULL ) { dprintf(D_ALWAYS, "EC2_GAHP not defined! \n"); return; } ArgList args; args.AppendArg("-f"); gahp = new GahpClient( EC2_RESOURCE_NAME, gahp_path, &args ); gahp->setNotificationTimerId( pingTimerId ); gahp->setMode( GahpClient::normal ); gahp->setTimeout( EC2Job::gahpCallTimeout ); status_gahp = new GahpClient( EC2_RESOURCE_NAME, gahp_path, &args ); StartBatchStatusTimer(); status_gahp->setNotificationTimerId( BatchPollTid() ); status_gahp->setMode( GahpClient::normal ); status_gahp->setTimeout( EC2Job::gahpCallTimeout ); free(gahp_path); }