Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
HPCasCode
Commits
d5100b12
Commit
d5100b12
authored
9 years ago
by
Jupiter Hu
Browse files
Options
Downloads
Plain Diff
Merge pull request #142 from CVL-GitHub/hpcidbranch10
fixed a bug
parents
35361f4a
965f4b68
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/karaage3.1.17/templates/kg_init.j2
+12
-1
12 additions, 1 deletion
roles/karaage3.1.17/templates/kg_init.j2
roles/slurm-common/templates/slurmlog.j2
+1
-1
1 addition, 1 deletion
roles/slurm-common/templates/slurmlog.j2
with
13 additions
and
2 deletions
roles/karaage3.1.17/templates/kg_init.j2
+
12
−
1
View file @
d5100b12
...
@@ -8,6 +8,8 @@ from karaage.institutes.models import Institute
...
@@ -8,6 +8,8 @@ from karaage.institutes.models import Institute
from
karaage.machines.models
import
MachineCategory
from
karaage.machines.models
import
MachineCategory
from
karaage.people.models
import
Person
,
Group
from
karaage.people.models
import
Person
,
Group
CONSOLE_DEBUG
=
False
class
HpcIdInit
():
class
HpcIdInit
():
import
django
import
django
django
.
setup
()
django
.
setup
()
...
@@ -17,6 +19,9 @@ class HpcIdInit():
...
@@ -17,6 +19,9 @@ class HpcIdInit():
self
.
path
=
configfile
self
.
path
=
configfile
self
.
password
=
password
self
.
password
=
password
self
.
debug
=
debug
self
.
debug
=
debug
if
not
debug
:
self
.
logfile
=
open
(
"
/tmp/kg_init.log
"
,
"
w
"
)
if
self
.
path
and
os
.
path
.
exists
(
self
.
path
):
if
self
.
path
and
os
.
path
.
exists
(
self
.
path
):
with
open
(
self
.
path
)
as
data
:
with
open
(
self
.
path
)
as
data
:
config_data
=
json
.
load
(
data
)
config_data
=
json
.
load
(
data
)
...
@@ -26,9 +31,14 @@ class HpcIdInit():
...
@@ -26,9 +31,14 @@ class HpcIdInit():
else
:
else
:
log
(
"
Invalid input data
"
)
log
(
"
Invalid input data
"
)
def
__del__
(
self
):
self
.
logfile
.
close
()
def
log
(
self
,
message
):
def
log
(
self
,
message
):
if
self
.
debug
:
if
self
.
debug
:
print
message
print
message
else
:
self
.
logfile
.
write
(
message
+
"
\n
"
)
def
getGroup
(
self
,
name
):
def
getGroup
(
self
,
name
):
group
=
None
group
=
None
...
@@ -173,6 +183,7 @@ class HpcIdInit():
...
@@ -173,6 +183,7 @@ class HpcIdInit():
try
:
try
:
delegates
=
institute
.
delegates
.
all
().
filter
(
username
=
su
.
username
)
delegates
=
institute
.
delegates
.
all
().
filter
(
username
=
su
.
username
)
if
len
(
delegates
)
==
0
:
if
len
(
delegates
)
==
0
:
self
.
log
(
"
Create institution delegate %s
"
%
(
su
.
username
))
institute
.
delegates
.
add
(
su
)
institute
.
delegates
.
add
(
su
)
except
:
except
:
result
=
False
result
=
False
...
@@ -216,7 +227,7 @@ def main(argv):
...
@@ -216,7 +227,7 @@ def main(argv):
if
len
(
sys
.
argv
)
>
2
:
if
len
(
sys
.
argv
)
>
2
:
config_path
=
argv
[
0
]
config_path
=
argv
[
0
]
password
=
argv
[
1
]
password
=
argv
[
1
]
debug
=
True
debug
=
CONSOLE_DEBUG
if
len
(
sys
.
argv
)
>
3
:
if
len
(
sys
.
argv
)
>
3
:
debug
=
argv
[
2
]
debug
=
argv
[
2
]
init
=
HpcIdInit
(
config_path
,
password
,
debug
)
init
=
HpcIdInit
(
config_path
,
password
,
debug
)
...
...
This diff is collapsed.
Click to expand it.
roles/slurm-common/templates/slurmlog.j2
+
1
−
1
View file @
d5100b12
{% if slurmctrl == inventory_hostname %}
{% if slurmctrl == inventory_hostname %}
{{ slurmctlddebug.log }}
{{ slurmctlddebug.log }}
{{ slurmschedlog.log }}
{{ slurmschedlog.log }}
{% else
*
}
{% else
%
}
{{ slurmddebug.log }}
{{ slurmddebug.log }}
{% endif %}
{% endif %}
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment