-
Notifications
You must be signed in to change notification settings - Fork 108
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
fix: nightly updater #1202
fix: nightly updater #1202
Conversation
engine/commands/cortex_upd_cmd.h
Outdated
@@ -83,7 +85,8 @@ inline bool ReplaceBinaryInflight(const std::filesystem::path& src, | |||
// Already has the newest | |||
return true; | |||
} | |||
std::filesystem::path temp = std::filesystem::temp_directory_path() / "cortex_temp"; | |||
std::filesystem::path temp = | |||
file_manager_utils::GetExecutableFolderContainerPath() / "cortex_temp"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should rename in the same folder
@@ -133,6 +133,17 @@ void ForkProcess() { | |||
int main(int argc, char* argv[]) { | |||
{ file_manager_utils::CreateConfigFileIfNotExist(); } | |||
|
|||
// Delete temporary file if it exists | |||
auto temp = | |||
file_manager_utils::GetExecutableFolderContainerPath() / "cortex_temp"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After cortex update, we can only remove temporary file at the next start
@@ -230,7 +230,7 @@ inline std::filesystem::path GetContainerFolderPath( | |||
} else if (type == "CudaToolkit") { | |||
container_folder_path = current_path; | |||
} else if (type == "Cortex") { | |||
container_folder_path = current_path / "cortex"; | |||
container_folder_path = std::filesystem::temp_directory_path() / "cortex"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Download binary to temp folder
@@ -190,7 +190,8 @@ bool CortexUpdCmd::GetNightly(const std::string& v) { | |||
|
|||
// Replace binay file | |||
auto executable_path = file_manager_utils::GetExecutableFolderContainerPath(); | |||
auto src = executable_path / "cortex" / GetCortexBinary(); | |||
auto src = std::filesystem::temp_directory_path() / "cortex" / kCortexBinary / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change accordingly to s3 structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ looks good to me
Describe Your Changes
cortex update
, we rename it tocortex_temp
then need to delete at the next start.Fixes Issues
Self Checklist