Skip to content

Commit

Permalink
fixup! show build log url when containers fails to build
Browse files Browse the repository at this point in the history
  • Loading branch information
sekharpanja committed Sep 20, 2024
1 parent de5eae4 commit 5466131
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dataworkspace/dataworkspace/apps/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ def public_error_500_html_view(request):

def public_error_500_application_view(request):
app_id = request.GET.get("application_id", "")
build_log = None
if app_id != "":
application = ApplicationInstance.objects.get(pk=app_id)
build_log = None
if request.GET.get("show_build_log", False):
build_log = f"{settings.GITLAB_URL}/deployment/docker-ecr/-/jobs/{application.spawner_application_instance_id}"
if application.application_template.include_in_dw_stats:
Expand All @@ -139,11 +139,16 @@ def public_error_500_application_view(request):
"tool": application.application_template.nice_name,
"started": application.spawner_created_at,
"failure_message": request.GET.get("failure_message", None),
"build_log_url": build_log,
},
)
return render(
request, "errors/error_500.html", {"message": request.GET.get("message", None)}, status=500
request,
"errors/error_500.html",
{
"message": request.GET.get("message", None),
"build_log": build_log
},
status=500
)


Expand Down
4 changes: 4 additions & 0 deletions dataworkspace/dataworkspace/templates/errors/error_500.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ <h1 class="govuk-heading-xl">Sorry, there is a problem with the service</h1>
<p class="govuk-body">{{ message }}</p>
{% endif %}

{% if build_log %}
<p class="govuk-body">{{ build_log }}</p>
{% endif %}

<p class="govuk-body">Please try again.</p>

<p class="govuk-body">If the problem continues, please <a class="govuk-link" href="{% url 'support' %}">contact the Data Workspace Support Team</a>.</p>
Expand Down

0 comments on commit 5466131

Please sign in to comment.