Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
allgo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
110
Issues
110
List
Boards
Labels
Service Desk
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
allgo
allgo
Commits
829cf402
Commit
829cf402
authored
Mar 28, 2019
by
sebastien letort
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'metrics' of
https://gitlab.inria.fr/allgo/allgo
into metrics
parents
31c9beed
8192af9f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
11 deletions
+14
-11
django/Dockerfile
django/Dockerfile
+5
-2
django/allgo/main/views.py
django/allgo/main/views.py
+9
-2
django/config/settings.py
django/config/settings.py
+0
-1
django/docs/models.png
django/docs/models.png
+0
-0
django/requirements_dev.txt
django/requirements_dev.txt
+0
-2
mysql/files/dk/container_init
mysql/files/dk/container_init
+0
-4
No files found.
django/Dockerfile
View file @
829cf402
...
...
@@ -10,9 +10,12 @@ RUN apt-getq update && apt-getq install \
python-mysqldb python3-crypto gunicorn3 python3-redis python-mysqldb
\
python3-crypto python3-natsort python3-aiohttp python3-aioredis supervisor
\
python3-ipy python3-django-taggit python3-iso8601 python3-robot-detection
\
python3-sqlparse python3-pydotplus
\
python3-sqlparse
\
# documentation
python3-sphinx \
make
make \
# generate the DB schema with graph_models, cf docs/generate_models_png.sh
python3-django-extensions python3-pydotplus
COPY
requirements.txt /tmp/
RUN
cd
/tmp
&&
pip3
install
-r
requirements.txt
&&
rm
requirements.txt
...
...
django/allgo/main/views.py
View file @
829cf402
...
...
@@ -182,6 +182,7 @@ class WebappList(AllAccessMixin, ListView):
def
get_queryset
(
self
):
return
query_webapps_for_user
(
self
.
request
.
user
).
order_by
(
'-created_at'
)
class
UserWebappList
(
AllAccessMixin
,
ListView
):
"""List of user's webapp
...
...
@@ -361,6 +362,7 @@ def get_rails_webapp_metadata(*, webapp_id=None, docker_name=None):
log
.
error
(
"webapp import error: failed to get %s (%s)"
,
url
,
e
)
raise
class
WebappImport
(
ProviderAccessMixin
,
SuccessMessageMixin
,
FormView
):
"""Import a new webapp
...
...
@@ -472,6 +474,7 @@ class WebappImport(ProviderAccessMixin, SuccessMessageMixin, FormView):
self
.
object
=
webapp
return
super
().
form_valid
(
form
)
class
WebappVersionImport
(
UserAccessMixin
,
DetailView
):
"""Import version
...
...
@@ -586,6 +589,7 @@ class WebappJson(UserAccessMixin, DetailView):
"sandbox_state"
:
webapp
.
get_sandbox_state_display
(),
})
class
WebappSandboxPanel
(
UserAccessMixin
,
TemplateView
):
"""Create a new sandbox for a given application
...
...
@@ -731,7 +735,6 @@ class WebappSandboxPanel(UserAccessMixin, TemplateView):
# TAGS
# -----------------------------------------------------------------------------
class
TagList
(
AllAccessMixin
,
ListView
):
"""List all available tag along with their number of occurences
...
...
@@ -947,6 +950,7 @@ class UserPasswordUpdate(LoginRequiredMixin, SuccessMessageMixin, UpdateView):
return
super
(
UserPasswordUpdate
,
self
)
\
.
dispatch
(
request
,
*
args
,
**
kwargs
)
class
UserNeedValidation
(
LoginRequiredMixin
,
DetailView
):
"""This page is displayed when the user has not completed the registration process
...
...
@@ -1225,6 +1229,7 @@ class JobCreate(AllAccessMixin, SuccessMessageMixin, CreateView):
kwargs
[
'webapp'
]
=
queryset
return
kwargs
class
JobAbort
(
JobAuthMixin
,
View
):
def
post
(
self
,
request
,
*
,
pk
):
job_id
=
int
(
pk
)
...
...
@@ -1238,6 +1243,7 @@ class JobAbort(JobAuthMixin, View):
messages
.
error
(
request
,
"unable to abort job %s because is not running"
%
job_id
)
return
redirect
(
'main:job_detail'
,
job_id
)
class
JobDelete
(
JobAuthMixin
,
DeleteView
):
"""Delete a job from the database
...
...
@@ -1296,6 +1302,7 @@ class JobDelete(JobAuthMixin, DeleteView):
messages
.
success
(
self
.
request
,
self
.
success_message
)
return
redirect
(
self
.
get_success_url
())
class
JobFileDownload
(
JobAuthMixin
,
View
):
"""Download a given file"""
...
...
@@ -1459,6 +1466,7 @@ class RunnerUpdate(UserAccessMixin, SuccessMessageMixin, UpdateView):
"allgo/runner"
,
"-"
,
self
.
object
.
token
,
get_base_url
(
self
.
request
)]
return
super
().
get_context_data
(
**
kwargs
)
class
RunnerDelete
(
UserAccessMixin
,
DeleteView
):
"""Delete a runner
...
...
@@ -1483,7 +1491,6 @@ class RunnerDelete(UserAccessMixin, DeleteView):
# -----------------------------------------------------------------------------
class
Metrics
(
ProviderAccessMixin
,
TemplateView
):
template_name
=
'metrics.html'
print
(
"##Site Metrics"
)
def
get
(
self
,
request
):
if
request
.
user
.
is_superuser
:
...
...
django/config/settings.py
View file @
829cf402
...
...
@@ -115,7 +115,6 @@ THIRD_PARTY_APPS = [
'allauth.socialaccount'
,
'allauth.socialaccount.providers.gitlab'
,
'taggit'
,
'django_extensions'
,
]
LOCAL_APPS
=
[
'main'
,
...
...
django/docs/models.png
deleted
100644 → 0
View file @
31c9beed
626 KB
django/requirements_dev.txt
View file @
829cf402
...
...
@@ -9,5 +9,3 @@ pytest==3.4.2
click==6.7
pypandoc==1.4
beautifulsoup4==4.6.0
python-jose==2.0.2
django-extensions
mysql/files/dk/container_init
View file @
829cf402
...
...
@@ -17,14 +17,10 @@ pid=$!
wait-socket /var/run/mysqld/mysqld.sock
# https://stackoverflow.com/questions/21351251/database-returned-an-invalid-value-in-queryset-dates
# Need to be tested (works on a working container, what about on initialization)
# This is necessary to use django Extract/Trunc function (for date management in QuerySets)
mysql_tzinfo_to_sql /usr/share/zoneinfo
\
| mysql
-D
mysql
-u
root
# maybe useless
# mysql -u root -e "flush tables;"
mysql
-uroot
mysql
<<
EOF
GRANT ALL ON allgo.* TO allgo@'%' IDENTIFIED BY 'allgo';
GRANT ALL ON allgo_test.* TO allgo@'%';
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment