Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
remi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
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
RobotLearn
RemI (Remote Inria)
remi
Commits
1f2fc3b5
Commit
1f2fc3b5
authored
4 years ago
by
LEPAGE Gaetan
Browse files
Options
Downloads
Patches
Plain Diff
minor things
parent
f7670ae3
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
percu/config/__init__.py
+1
-1
1 addition, 1 deletion
percu/config/__init__.py
percu/config/defaults.py
+8
-8
8 additions, 8 deletions
percu/config/defaults.py
percu/core.py
+3
-3
3 additions, 3 deletions
percu/core.py
percu/remote.py
+2
-3
2 additions, 3 deletions
percu/remote.py
pylintrc
+2
-1
2 additions, 1 deletion
pylintrc
with
16 additions
and
16 deletions
percu/config/__init__.py
+
1
−
1
View file @
1f2fc3b5
...
...
@@ -160,7 +160,7 @@ class Config: # pylint: disable=too-few-public-methods
@staticmethod
def
get
()
->
'
Config
'
:
# TODO change this for a
single
Singleton ?
# TODO change this for a
conventional
Singleton ?
global
_CONFIG
# pylint: disable=global-statement
if
_CONFIG
is
None
:
_CONFIG
=
Config
.
_create
()
...
...
This diff is collapsed.
Click to expand it.
percu/config/defaults.py
+
8
−
8
View file @
1f2fc3b5
...
...
@@ -10,16 +10,16 @@ import yaml
from
..utils
import
prompt_user
,
print_info
,
print_warning
def
create_default_project
(
path
:
str
):
def
create_default_project
():
"""
Generate the des TODO
"""
dot_percu
:
str
=
'
.percu/
'
config
s
_file
=
join
(
dot_percu
,
'
configs.yaml
'
)
config_file
=
join
(
dot_percu
,
'
configs.yaml
'
)
config
:
dict
[
str
,
Any
]
=
{}
if
not
isfile
(
config
s
_file
):
print_info
(
"
Generating configuration
s
"
)
if
not
isfile
(
config_file
):
print_info
(
"
Generating configuration
file
"
)
cwd
:
str
=
basename
(
getcwd
())
config
[
'
project_name
'
]
=
input
(
f
"
Project name [
{
cwd
}
]:
"
).
strip
()
or
cwd
config
[
'
username
'
]
=
input
(
"
Inria username:
"
).
strip
()
...
...
@@ -96,20 +96,20 @@ def create_default_project(path: str):
mkdir
(
dot_percu
)
# Then, dump the config to the config file if it doesn't already exists
if
not
isfile
(
config
s
_file
):
with
open
(
config
s
_file
,
'
w
'
)
as
file_stream
:
if
not
isfile
(
config_file
):
with
open
(
config_file
,
'
w
'
)
as
file_stream
:
yaml
.
dump
(
data
=
config
,
stream
=
file_stream
,
default_flow_style
=
False
,
sort_keys
=
False
)
else
:
print_info
(
f
'
Config file (`
{
config
s
_file
}
`) already exists: skipping.
'
)
print_info
(
f
'
Config file (`
{
config_file
}
`) already exists: skipping.
'
)
exclude_file
=
join
(
dot_percu
,
'
exclude.txt
'
)
with
open
(
join
(
dot_percu
,
'
.gitignore
'
),
'
a
'
)
as
gitignore
:
gitignore
.
write
(
'
*
'
)
gitignore
.
write
(
config
s
_file
)
gitignore
.
write
(
config_file
)
gitignore
.
write
(
exclude_file
)
if
not
isfile
(
exclude_file
):
...
...
This diff is collapsed.
Click to expand it.
percu/core.py
+
3
−
3
View file @
1f2fc3b5
...
...
@@ -158,16 +158,16 @@ def clean(directory: str,
def
init
()
->
None
:
"""
Create the default project
. Generate the configuration files.
Initialize the project in the current working directory
. Generate the configuration files.
"""
print_info
(
text
=
'
Creating a brand new percu project.
'
,
bold
=
True
)
create_default_project
(
path
=
'
.
'
)
create_default_project
()
def
setup
(
hostname
:
str
)
->
None
:
"""
S
ync the project, update packages
.
S
et up remote project location and install virtual environment if any
.
Args:
hostname (str): The hostname of the remote computer.
...
...
This diff is collapsed.
Click to expand it.
percu/remote.py
+
2
−
3
View file @
1f2fc3b5
...
...
@@ -53,9 +53,8 @@ def remote(sub_command: str,
if
container_path
!=
''
:
cmd
.
append
(
container_path
)
cmd
+=
[
'
--nv
'
]
cmd
+=
[
config
.
singularity
.
output_sif_name
]
# Enable GPU support and provide the path to the container image
cmd
+=
[
'
--nv
'
,
config
.
singularity
.
output_sif_name
]
# Enable virtual environment if any.
elif
config
.
virtual_env
is
not
None
and
config
.
virtual_env
.
enabled
:
...
...
This diff is collapsed.
Click to expand it.
pylintrc
+
2
−
1
View file @
1f2fc3b5
...
...
@@ -140,7 +140,8 @@ disable=print-statement,
exception-escape,
comprehension-escape,
missing-function-docstring,
too-many-branches
too-many-branches,
too-many-statements
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
...
...
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