[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] SCHEDD CRON not updating classAD dynamically like STARTD CRON



Hi Vikrant-

I do see that the manual has a comment about schedd cron hooks requiring a restart of the schedd.

# Schedd Cron Stuff. Unlike the Startd,
# a restart of the Schedd is required for changes to take effect

You also have a problem in that your instancetype value is not being printed out in quotes, so HTCondor is treating the dash as a subtraction operator.

It looks like you are on AWS. You might want to look into adopting the script that Todd Miller wrote for standard AWS ClassAds. I wrote a corresponding script for Google Cloud Platform. The goal is for there to be standard ClassAd attributes across Cloud Providers (one of them is instance type).

https://github.com/htcondor/htcondor/blob/master/src/condor_scripts/common-cloud-attributes-aws.py
https://github.com/htcondor/htcondor/blob/master/src/condor_utils/param_info.in#L6726

It will be packaged in 9.4, but there's nothing magic about the script that requires 9.4. You can download it and add it manually.

Tom

On Tue, Oct 26, 2021 at 8:29 AM <ervikrant06@xxxxxxxxx> wrote:
Hello Experts,

Put together this configuration to add classad into schedd dynamically. it doesn't work as expected, similar kinda configuration works absolutely fine for STARTD CRONs without condor_reconfig.

SCHEDD_CRON_AUTOPUBLISH = always
SCHEDD_CRON_CONFIG_VAL = $(RELEASE_DIR)/bin/condor_config_val
SCHEDD_CRON_INSTANCETYPE_RECONFIG = true
SCHEDD_CRON_INSTANCETYPE_RECONFIG_RERUN = true
SCHEDD_CRON_JOBLIST = INSTANCETYPE
SCHEDD_CRON_INSTANCETYPE_EXECUTABLE = /var/tmp/test.sh
SCHEDD_CRON_INSTANCETYPE_PERIOD = 10s

Verified that the script is getting called every 10s by creating a file in /tmp filesystem.Â

#!/bin/bash
# Executed by Condor to periodically set custom class ad attributes

exec 2>/dev/null
epoch_date=$(date +%s)
touch /tmp/testfile_${epoch_date}
instancetype="c5-${epoch_date}"
echo "instancetype = ${instancetype}"

Upon condor_reconfig it's reflecting the change.Â

# condor_status test.example.com -schedd Â-l | grep -i instance
instancetype = c5 - 1635254575

Is this expected behavior?Â

Thanks & Regards,
Vikrant Aggarwal
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/