Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rosetta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
ExaCT
Rosetta
Commits
5558e3e1
Commit
5558e3e1
authored
5 years ago
by
Stefano Alberto Russo
Browse files
Options
Downloads
Patches
Plain Diff
Added testuser demo container as Jupyter Notebook and made is admin.
parent
119a2a63
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
images/webapp/code/rosetta/base_app/management/commands/base_app_populate.py
+23
-5
23 additions, 5 deletions
...rosetta/base_app/management/commands/base_app_populate.py
with
23 additions
and
5 deletions
images/webapp/code/rosetta/base_app/management/commands/base_app_populate.py
+
23
−
5
View file @
5558e3e1
...
...
@@ -18,14 +18,22 @@ class Command(BaseCommand):
# Testuser
try
:
User
.
objects
.
get
(
username
=
'
testuser
'
)
testuser
=
User
.
objects
.
get
(
username
=
'
testuser
'
)
print
(
'
Not creating test user as it already exist
'
)
except
User
.
DoesNotExist
:
print
(
'
Creating test user with default password
'
)
testuser
=
User
.
objects
.
create_user
(
'
testuser
'
,
'
testuser@rosetta.platform
'
,
'
testpass
'
)
print
(
'
Making testuser admin
'
)
testuser
.
is_staff
=
True
testuser
.
is_admin
=
True
testuser
.
is_superuser
=
True
testuser
.
save
()
print
(
'
Creating testuser profile
'
)
Profile
.
objects
.
create
(
user
=
testuser
,
authtoken
=
'
129aac94-284a-4476-953c-ffa4349b4a50
'
)
#
p
ublic containers
#
P
ublic containers
public_containers
=
Container
.
objects
.
filter
(
user
=
None
)
if
public_containers
:
print
(
'
Not creating public containers as they already exist
'
)
...
...
@@ -47,9 +55,19 @@ class Command(BaseCommand):
service_ports
=
'
8590
'
)
# Public containers
testuser_containers
=
Container
.
objects
.
filter
(
user
=
testuser
)
if
testuser_containers
:
print
(
'
Not creating testuser containers as they already exist
'
)
else
:
print
(
'
Creating testuser containers...
'
)
# JuPyter
Container
.
objects
.
create
(
user
=
testuser
,
image
=
'
jupyter/base-notebook
'
,
type
=
'
docker
'
,
registry
=
'
docker_hub
'
,
service_ports
=
'
8888
'
)
...
...
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