-
Notifications
You must be signed in to change notification settings - Fork 15
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
Include CI for loadbalancer and hyperqueue testing #67
Draft
Crambor
wants to merge
6
commits into
main
Choose a base branch
from
ci/include-ci-for-loadbalancer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
87330be
fix: #59 directly check for hq binary in hpc directory
Crambor 51cec68
ci: #52 initial steps for bundled release
Crambor 6f3d738
fix(ci): accidentally grepped all occurences
Crambor 4648e38
chore(ci): QoL silencing on apt
Crambor 28ce6f1
fix(ci): remove unnecessary version checking logic
Crambor db74b17
fix: #59 add hq binary check in allocation queue script
Dariuscpt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: hpc-load-balancer | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
|
||
jobs: | ||
|
||
build-and-setup: | ||
runs-on: ubuntu-latest | ||
container: ubuntu:latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Dependencies | ||
run: | | ||
apt update -qq && DEBIAN_FRONTEND="noninteractive" apt install -yq g++ make wget curl tar | ||
|
||
- name: Build load balancer binary | ||
run: | | ||
cd hpc && make build-load-balancer | ||
|
||
- name: Download and setup hq binary | ||
run: | | ||
url=$(curl -sSL https://api.github.com/repos/It4innovations/hyperqueue/releases/latest | \ | ||
grep -o "\"browser_download_url\": \"https://[^\"]*-linux-x64.tar.gz\"" | \ | ||
cut -d '"' -f 4) | ||
if [ -z "$url" ]; then | ||
echo "Error: URL not found" | ||
exit 1 | ||
fi | ||
|
||
filename="hq-linux-x64.tar.gz" | ||
wget -q $url -O $filename | ||
tar xzf $filename | ||
./hq --version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,15 +25,19 @@ void clear_url(std::string directory) { | |
} | ||
|
||
void launch_hq_with_alloc_queue() { | ||
std::system("hq server stop &> /dev/null"); | ||
std::system("./hq server stop &> /dev/null"); | ||
|
||
std::system("hq server start &"); | ||
std::system("./hq server start &"); | ||
sleep(1); // Workaround: give the HQ server enough time to start. | ||
|
||
// Create HQ allocation queue | ||
std::system("hq_scripts/allocation_queue.sh"); | ||
} | ||
|
||
bool file_exists(const std::string& path) { | ||
return std::filesystem::exists(path); | ||
} | ||
|
||
const std::vector<std::string> get_model_names() { | ||
// Don't start a client, always use the default job submission script. | ||
HyperQueueJob hq_job("", false, true); | ||
|
@@ -49,6 +53,13 @@ int main(int argc, char *argv[]) | |
create_directory_if_not_existing("sub-jobs"); | ||
clear_url("urls"); | ||
|
||
// Check if the hq binary exists | ||
std::string hq_binary_path = "./hq"; | ||
if (!file_exists(hq_binary_path)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea! Could do similar checks for job.sh and alloc script as well! |
||
std::cerr << "Error: hq binary does not exist at " << hq_binary_path << std::endl; | ||
return 1; | ||
} | ||
|
||
launch_hq_with_alloc_queue(); | ||
|
||
// Read environment variables for configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
kind of redundant?
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.
ah true - habit, thought I would use it more