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

Add GetDefault and SetDefault to AllcationInterface #939

Merged
merged 6 commits into from
Apr 25, 2021

Conversation

splhack
Copy link
Contributor

@splhack splhack commented Mar 21, 2021

Goal

This PR aims to fix Cuebot, PyCue, and PyOutline for unblocking us to manage allocations.

Two facilities

  • main_cpu
  • main_gpu

Two allocations

  • main_cpu.general
  • main_gpu.general

Currently, both cuegui and cueadmin don't have the functionality to achieve the goal.
Use PyCue script instead.

import opencue

for host in opencue.api.getHosts():
    opencue.api.deleteHost(host.data)

main_cpu = opencue.api.createFacility("main_cpu")
main_gpu = opencue.api.createFacility("main_gpu")

main_cpu_general = opencue.api.createAllocation("main_cpu.general", "general", main_cpu)
main_gpu_general = opencue.api.createAllocation("main_gpu.general", "general", main_gpu)

opencue.api.setDefaultAllocation(main_cpu_general.data)

for name in [
    "cloud.general",
    "cloud.unassigned",
    "local.desktop",
    "local.general",
    "local.unassigned",
]:
    try:
        alloc = opencue.api.getAllocation(name)
        opencue.api.deleteAllocation(alloc.data)
    except Exception as e:
        print(e)

Issues (commits)

Version bump

Because of proto file change. Assuming #938 merged first.

(includes #942 to fix CI)

@splhack splhack force-pushed the fix-allocation branch 5 times, most recently from 57dcb0f to f24ea7e Compare March 24, 2021 02:57
splhack added a commit to splhack/OpenCue that referenced this pull request Mar 24, 2021
@splhack splhack force-pushed the fix-allocation branch 2 times, most recently from 255d09e to 570bdfc Compare April 8, 2021 08:00
@splhack splhack changed the title Fix allocation Add GetDefault and SetDefault to AllcationInterface Apr 8, 2021
@splhack
Copy link
Contributor Author

splhack commented Apr 8, 2021

refactored this with easy fixes and unit tests #953, #954, and #955 for code reviewability 🙂 hope get those merged first.

@splhack
Copy link
Contributor Author

splhack commented Apr 11, 2021

ready to merge.

Copy link
Collaborator

@bcipriano bcipriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bcipriano bcipriano merged commit 847ee50 into AcademySoftwareFoundation:master Apr 25, 2021
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.

None yet

3 participants