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

126 grapher registration with chronovisor #153

Merged
merged 42 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1285245
remove deprecated ChronoKeeper/chrono_common/*
ibrodkin Mar 4, 2024
4607871
corrected include references
ibrodkin Mar 7, 2024
8c80d4e
StoryChunk bound: start
ibrodkin Mar 7, 2024
6cde88b
chrono_grapher POC
ibrodkin Mar 13, 2024
8b41747
GrapherRecordingService
ibrodkin Mar 20, 2024
1fdef9b
StoryChunk serialization
ibrodkin Mar 22, 2024
72f40e1
Grapher Configuration and GrapherRegClient
ibrodkin Mar 27, 2024
d9baa37
grapher registration checkpoint
ibrodkin Apr 3, 2024
1405bb4
Grapher registration checkpoint
ibrodkin Apr 5, 2024
4edff43
Use getent to get Visor IP
fkengun Mar 12, 2024
2c5af08
Make sure there is only one Visor
fkengun Mar 12, 2024
aae479d
Keepers need to have service_ip for KeeperRecordingService and Keeper…
fkengun Mar 13, 2024
6cece7a
Add conf_file command line argument
fkengun Mar 21, 2024
b74d952
Change default log file size to 1MB
fkengun Mar 21, 2024
bfadff4
Update variables on non-default paths from command line
fkengun Mar 26, 2024
45bdc41
FEAT: Updated README.md
EnekoGonzalez3 Mar 28, 2024
aeee569
Delete unnecessary horizontal lines at README.md
EnekoGonzalez3 Mar 28, 2024
b1fda0e
Update spack and website links
EnekoGonzalez3 Mar 28, 2024
6358cfb
Updated readme with requested changes
EnekoGonzalez3 Apr 2, 2024
28b3e08
Updated readme with requested changes
EnekoGonzalez3 Apr 4, 2024
c6b6cef
Move environment installation after checking the status
EnekoGonzalez3 Apr 5, 2024
655b174
StoryChunk serialization fixed
ibrodkin Apr 5, 2024
209969d
CMakeLists.txt changes
ibrodkin Apr 5, 2024
b5d615b
Grapher Configuration and GrapherRegClient
ibrodkin Mar 27, 2024
4250ac1
RecordingGroupId, ServiceID.h and registration message reorg
ibrodkin Apr 11, 2024
bd7c226
grapher delayed exit
ibrodkin Apr 11, 2024
b1ba901
moved KeeperProcess map to RecordingGroup level
ibrodkin Apr 11, 2024
e8c103f
concept of activeGroups, uniform_group_distribution, mersene twister …
ibrodkin Apr 17, 2024
d8d3488
reworked recordingGroup notifications about story Start/stop
ibrodkin Apr 18, 2024
25994b9
Fix typo in help page
fkengun Apr 10, 2024
cb83038
Add -l for local deployment, and -e for verbose output
fkengun Apr 11, 2024
6cec659
Print default values in usage output
fkengun Apr 11, 2024
df82027
Grapher Configuration and GrapherRegClient
ibrodkin Mar 27, 2024
c3238f9
Merge branch 'develop' into 126-grapher-registration-with-chronovisor
ibrodkin Apr 18, 2024
dd4dd21
HOTFIX: keeper chunk_filename=storyId.chunkStartTime.keeperIP.port.csv
ibrodkin Apr 18, 2024
d727547
added operator +=(string,..) for ServiceId, KeeperIdCard, GrapherIdCard
ibrodkin Apr 23, 2024
4fd6c2b
better tracking of recording group activity status
ibrodkin Apr 24, 2024
77677e4
Merge branch 'develop' into 126-grapher-registration-with-chronovisor
ibrodkin Apr 25, 2024
1b49647
fixed no-return in CSVFileExtractor
ibrodkin Apr 25, 2024
f25955b
fixed merging issues
ibrodkin Apr 25, 2024
e623b7b
uint64_t story_start_time
ibrodkin Apr 25, 2024
06295ec
addeed RecordingGroup to configuration
ibrodkin Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ChronoVisor/include/ChronicleMetaDirectory.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ class ChronicleMetaDirectory

int destroy_chronicle(const std::string &name);

//int create_story(std::string const& chronicle_name, const std::string& story_name,
// const std::unordered_map<std::string, std::string>& attrs);
int destroy_story(std::string const &chronicle_name, const std::string &story_name);

int
acquire_story(chronolog::ClientId const &client_id, const std::string &chronicle_name, const std::string &story_name
, const std::unordered_map <std::string, std::string> &attrs, int &flags, StoryId &, bool &);
, const std::unordered_map <std::string, std::string> &attrs, int &flags, StoryId &);

int
release_story(chronolog::ClientId const &client_id, const std::string &chronicle_name, const std::string &story_name
, StoryId &, bool &);
, StoryId &);

int get_chronicle_attr(std::string const &name, const std::string &key, std::string &value);

Expand Down
18 changes: 8 additions & 10 deletions ChronoVisor/include/KeeperRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,11 @@ class KeeperProcessEntry
, active(false)
, lastStatsTime(0)
, activeStoryCount(0)
{}

KeeperProcessEntry(KeeperProcessEntry const& other) = default;

void reset()
{
keeperAdminClient = nullptr;
active = false;
lastStatsTime = 0;
activeStoryCount = 0;
idCardString += idCard;
}

KeeperProcessEntry(KeeperProcessEntry const& other) = default;
~KeeperProcessEntry() = default;// Registry is reponsible for creating & deleting keeperAdminClient

KeeperIdCard idCard;
Expand All @@ -77,7 +70,9 @@ class GrapherProcessEntry
, active(false)
, lastStatsTime(0)
, activeStoryCount(0)
{}
{
idCardString += idCard;
}

GrapherProcessEntry(GrapherProcessEntry const& other) = default;
~GrapherProcessEntry() = default;// Registry is reponsible for creating & deleting keeperAdminClient
Expand All @@ -98,12 +93,14 @@ class GrapherProcessEntry
public:
RecordingGroup(RecordingGroupId group_id, GrapherProcessEntry* grapher_ptr = nullptr)
: groupId(group_id)
, activeKeeperCount(0)
, grapherProcess(grapher_ptr)
{}

RecordingGroup(RecordingGroup const& other) = default;
~RecordingGroup() = default;

bool isActive() const;
void startDelayedGrapherExit(GrapherProcessEntry&, std::time_t);
void clearDelayedExitGrapher(GrapherProcessEntry&, std::time_t);
void startDelayedKeeperExit(KeeperProcessEntry&, std::time_t);
Expand All @@ -112,6 +109,7 @@ class GrapherProcessEntry
std::vector<KeeperIdCard>& getActiveKeepers(std::vector<KeeperIdCard>& keeper_id_cards);

RecordingGroupId groupId;
size_t activeKeeperCount;
GrapherProcessEntry* grapherProcess;
std::map<std::pair<uint32_t, uint16_t>, KeeperProcessEntry> keeperProcesses;
};
Expand Down
55 changes: 2 additions & 53 deletions ChronoVisor/src/ChronicleMetaDirectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,53 +171,6 @@ int ChronicleMetaDirectory::destroy_chronicle(const std::string &name)
}
}

/**
* Create a Story
* @param chronicle_name: name of the Chronicle that the Story belongs to
* @param story_name: name of the Story
* @param attrs: attributes associated with the Story
* @return CL_SUCCESS if succeed to create the Story \n
* CL_ERR_NOT_EXIST if the Chronicle does not exist \n
* CL_ERR_STORY_EXISTS if a Story with the same name already exists \n
* CL_ERR_UNKNOWN otherwise
*/
/*int ChronicleMetaDirectory::create_story(std::string const& chronicle_name,
const std::string &story_name,
const std::unordered_map<std::string, std::string> &attrs) {
LOG_DEBUG("creating Story name=%s in Chronicle name=%s", story_name.c_str(), chronicle_name.c_str());
std::chrono::steady_clock::time_point t1, t2;
t1 = std::chrono::steady_clock::now();
std::lock_guard<std::mutex> chronicleMapLock(g_chronicleMetaDirectoryMutex_);
// First check if Chronicle exists, fail if false
uint64_t cid;
// auto name2IdRecord = chronicleName2IdMap_->find(chronicle_name);
// if (name2IdRecord != chronicleName2IdMap_->end()) {
// cid = name2IdRecord->second;
cid = CityHash64(chronicle_name.c_str(), chronicle_name.length());
auto chronicleMapRecord = chronicleMap_->find(cid);
if (chronicleMapRecord != chronicleMap_->end()) {
Chronicle *pChronicle = chronicleMap_->find(cid)->second;
LOG_DEBUG("Chronicle@%p", &(*pChronicle));
//TODO: check if the story exists and handle it gracefully
uint64_t sid = pChronicle->getStoryId(story_name);
if (sid> 0) {
LOG_DEBUG("StoryID=%lu name=%s exists", sid, story_name.c_str());
return CL_ERR_STORY_EXISTS;
}
else
{
CL_Status res = pChronicle->addStory(chronicle_name, cid, story_name, attrs);
t2 = std::chrono::steady_clock::now();
std::chrono::duration<double, std::nano> duration = (t2 - t1);
LOG_DEBUG("time in %s: %lf ns", __FUNCTION__, duration.count());
return res;
}
} else {
LOG_DEBUG("Chronicle name=%s does not exist", chronicle_name.c_str());
return CL_ERR_NOT_EXIST;
}
}
*/

/**
* Destroy a Story
Expand Down Expand Up @@ -285,15 +238,14 @@ int ChronicleMetaDirectory::destroy_story(std::string const &chronicle_name, con
* @param story_name: name of the Story
* @param flags: flags
* @param story_id to populate with the story_id assigned to the story
* @param notify_keepers , bool value that would be set to true if this is the first client to acquire the story
* @return CL_SUCCESS if succeed to destroy the Story \n
* CL_ERR_NOT_EXIST if the Chronicle does not exist \n
* CL_ERR_UNKNOWN otherwise
*/
int ChronicleMetaDirectory::acquire_story(chl::ClientId const &client_id, const std::string &chronicle_name
, const std::string &story_name
, const std::unordered_map <std::string, std::string> &attrs, int &flags
, StoryId &story_id, bool &notify_keepers)
, StoryId &story_id)
{
LOG_DEBUG("[ChronicleMetaDirectory] ClientID={} acquiring StoryName={} in ChronicleName={} with Flags={}", client_id
, story_name.c_str(), chronicle_name.c_str(), flags);
Expand Down Expand Up @@ -332,7 +284,6 @@ int ChronicleMetaDirectory::acquire_story(chl::ClientId const &client_id, const

/* All checks passed, manipulate metadata */
story_id = pStory->getSid();
notify_keepers = (pStory->getAcquisitionCount() == 0 ? true : false);

/* Increment AcquisitionCount */
pStory->incrementAcquisitionCount();
Expand All @@ -350,14 +301,13 @@ int ChronicleMetaDirectory::acquire_story(chl::ClientId const &client_id, const
* @param story_name: name of the Story
* @param flags: flags
* @param story_id to populate with the story_id assigned to the story
* @param notify_keepers , bool value that would be set to true if this is the last client to release the story
* @return CL_SUCCESS if succeed to destroy the Story \n
* CL_ERR_NOT_EXIST if the Chronicle does not exist \n
* CL_ERR_UNKNOWN otherwise
*/
//TO_DO return acquisition_count after the story has been released
int ChronicleMetaDirectory::release_story(chl::ClientId const &client_id, const std::string &chronicle_name
, const std::string &story_name, StoryId &story_id, bool &notify_keepers)
, const std::string &story_name, StoryId &story_id)
{
LOG_DEBUG("[ChronicleMetaDirectory] ClientID={} releasing StoryName={} in ChronicleName={}", client_id
, story_name.c_str(), chronicle_name.c_str());
Expand Down Expand Up @@ -389,7 +339,6 @@ int ChronicleMetaDirectory::release_story(chl::ClientId const &client_id, const
/* Decrement AcquisitionCount */
pStory->decrementAcquisitionCount();
story_id = pStory->getSid();
notify_keepers = (pStory->getAcquisitionCount() == 0 ? true : false);
/* Remove this client from acquirerClientList of the Story */
pStory->removeAcquirerClient(client_id);
/* Remove this Story from acquiredStoryMap for this client */
Expand Down
Loading