Versioning (#568)

- removed getClientServerAPIVersion in server (not used)
- removed rxr side (clientversion compatibility check), removed enum as well as it is now done on the client side.
- versionAPI.h
   - GITBRANCH changed to RELEASE
   - dates for all API changed to "sem_version date". Scripts to compile servers modified for this. Empty "branch" name will end up with developer for sem_version.

- Version class with constructor taking in the long version (APILIB date). Other member functions including concise(to get sem_version for new releases and date for old releases), 
  
- bypassing initial tests, also now bypasses the client-rxr compatibility check (at rx_hostname command)

- previously, compatibility between client-det was ensuring both had the same detector API (eg. same APIJUNGFRAU)
   - Now, compatibility only checks APILIB (client side) and detector API(eg. APIJUNGFRAU) (detector side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. 
   - If server is from an older release, it will compare dates like previous implementation (APIJUNGFRAU from both client and det)
 
- - previously, compatibility between client-rxr was ensuring both had the same APIRECEIVER
   - Now, compatibility only checks APILIB (client side) and APIRECEIVER (rxr side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. 
   - If rxr is from an older release, it will compare dates like previous implementation (APIRECEIVER from both client and rxr)

- removed APIGUI, evalVersionVariables.sh, genVersionHeader.sh (not needed or not used)

- clientVersion, rxrversion and detectorserverversion all return strings and not integers (in hex) anymore. Depending if it has semantic versioning, it will print that or the date if it is too old.

- fixed in python (strings for versions)
- check_version function in detector server changed to "initial checks" as it only checks server-firmware compatibility and initial server checks. Client compatibilities are moved to client side.
- --version gives sem_version and date? Is date needed as well. The clientversion, detserverversion and rxrversion API gives only sem_version (no date)
- - formatting
This commit is contained in:
Dhanya Thattil
2022-11-09 11:13:09 +01:00
committed by GitHub
parent b150db0fb3
commit 05f657c106
56 changed files with 609 additions and 414 deletions

View File

@ -9,6 +9,7 @@
#include "DetectorImpl.h"
#include "Module.h"
#include "sls/Pattern.h"
#include "sls/Version.h"
#include "sls/container_utils.h"
#include "sls/file_utils.h"
#include "sls/logger.h"
@ -112,15 +113,18 @@ void Detector::setVirtualDetectorServers(int numServers, int startingPort) {
int Detector::getShmId() const { return pimpl->getDetectorIndex(); }
std::string Detector::getPackageVersion() const { return GITBRANCH; }
std::string Detector::getPackageVersion() const { return RELEASE; }
int64_t Detector::getClientVersion() const { return APILIB; }
std::string Detector::getClientVersion() const {
Version v(APILIB);
return v.concise();
}
Result<int64_t> Detector::getFirmwareVersion(Positions pos) const {
return pimpl->Parallel(&Module::getFirmwareVersion, pos);
}
Result<int64_t> Detector::getDetectorServerVersion(Positions pos) const {
Result<std::string> Detector::getDetectorServerVersion(Positions pos) const {
return pimpl->Parallel(&Module::getDetectorServerVersion, pos);
}
@ -136,7 +140,7 @@ Result<int> Detector::getModuleId(Positions pos) const {
return pimpl->Parallel(&Module::getModuleId, pos);
}
Result<int64_t> Detector::getReceiverVersion(Positions pos) const {
Result<std::string> Detector::getReceiverVersion(Positions pos) const {
return pimpl->Parallel(&Module::getReceiverSoftwareVersion, pos);
}
@ -1123,14 +1127,16 @@ Result<std::string> Detector::getRxHostname(Positions pos) const {
}
void Detector::setRxHostname(const std::string &receiver, Positions pos) {
pimpl->Parallel(&Module::setReceiverHostname, pos, receiver);
pimpl->Parallel(&Module::setReceiverHostname, pos, receiver,
pimpl->getInitialChecks());
updateRxRateCorrections();
}
void Detector::setRxHostname(const std::vector<std::string> &name) {
// set all to same rx_hostname
if (name.size() == 1) {
pimpl->Parallel(&Module::setReceiverHostname, {}, name[0]);
pimpl->Parallel(&Module::setReceiverHostname, {}, name[0],
pimpl->getInitialChecks());
} else {
if ((int)name.size() != size()) {
throw RuntimeError(
@ -1139,7 +1145,8 @@ void Detector::setRxHostname(const std::vector<std::string> &name) {
}
// set each rx_hostname
for (int idet = 0; idet < size(); ++idet) {
pimpl->Parallel(&Module::setReceiverHostname, {idet}, name[idet]);
pimpl->Parallel(&Module::setReceiverHostname, {idet}, name[idet],
pimpl->getInitialChecks());
}
}
updateRxRateCorrections();