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

fix: nightly updater #1202

Merged
merged 5 commits into from
Sep 13, 2024
Merged

fix: nightly updater #1202

merged 5 commits into from
Sep 13, 2024

Conversation

vansangpfiev
Copy link
Contributor

@vansangpfiev vansangpfiev commented Sep 12, 2024

Describe Your Changes

  • bugfix for nightly updater. We can not delete executable file after cortex update, we rename it to cortex_temp then need to delete at the next start.

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@@ -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";
Copy link
Contributor Author

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";
Copy link
Contributor Author

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";
Copy link
Contributor Author

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 /
Copy link
Contributor Author

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

@vansangpfiev vansangpfiev marked this pull request as ready for review September 12, 2024 10:27
Copy link
Contributor

@namchuai namchuai left a 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

@vansangpfiev vansangpfiev merged commit 89979b3 into dev Sep 13, 2024
4 checks passed
@vansangpfiev vansangpfiev deleted the fix/nightly-updater branch September 13, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants