Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Sciencebeam Gym
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sciencebeam
Sciencebeam Gym
Commits
c1b52eb6
Commit
c1b52eb6
authored
7 years ago
by
Daniel Ecer
Browse files
Options
Downloads
Patches
Plain Diff
moved process_sciencebeam_gym_dep_args to sciencebeam-gym
parent
aebc5368
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sciencebeam_gym/beam_utils/main.py
+27
-0
27 additions, 0 deletions
sciencebeam_gym/beam_utils/main.py
with
27 additions
and
0 deletions
sciencebeam_gym/beam_utils/main.py
+
27
−
0
View file @
c1b52eb6
...
...
@@ -42,6 +42,33 @@ def get_default_job_name(name, suffix=''):
timestamp_str
=
strftime
(
"
%Y%m%d-%H%M%S
"
,
gmtime
())
return
'
%s-%s%s-%s
'
%
(
name
or
'
beamapp
'
,
getuser
(),
suffix
or
''
,
timestamp_str
)
def
get_or_create_sciencebeam_gym_dist_path
():
import
sys
import
pkg_resources
dist
=
pkg_resources
.
get_distribution
(
"
sciencebeam_gym
"
)
sciencebeam_gym_path
=
dist
.
location
sciencebeam_gym_version
=
dist
.
version
subprocess
.
call
([
'
python
'
,
'
setup.py
'
,
'
sdist
'
],
cwd
=
sciencebeam_gym_path
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
sciencebeam_gym_dist_path
=
os
.
path
.
join
(
sciencebeam_gym_path
,
'
dist/sciencebeam_gym-%s.tar.gz
'
%
sciencebeam_gym_version
)
return
sciencebeam_gym_dist_path
def
process_sciencebeam_gym_dep_args
(
args
):
"""
If in cloud mode, add local sciencebeam-gym dependency and build distribution.
That way we don
'
t need to keep an updated public package available.
(the project may be re-structured by then)
"""
if
args
.
cloud
:
sciencebeam_gym_dist_path
=
get_or_create_sciencebeam_gym_dist_path
()
get_logger
().
info
(
'
sciencebeam_gym_dist_path: %s
'
,
sciencebeam_gym_dist_path
)
args
.
extra_package
=
sciencebeam_gym_dist_path
def
add_cloud_args
(
parser
):
parser
.
add_argument
(
'
--cloud
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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