Commit e70677ee authored by Tamas Gal's avatar Tamas Gal 💬

Add automatic session cookie for GitLab CI

parent f4520259
Pipeline #12436 passed with stages
in 33 minutes and 29 seconds
......@@ -70,6 +70,13 @@ def we_are_on_jupyterhub():
return ip == socket.gethostbyname("")
def we_are_on_km3net_gitlab_ci():
"""Check if we are on a GitLab CI runner server"""
import urllib.request
external_ip = urllib.request.urlopen('').read().decode('utf8')
return external_ip == ''
def read_csv(text, sep="\t"):
"""Create a DataFrame from CSV text"""
import pandas as pd # no top level load to make a faster import of db
......@@ -119,6 +126,11 @@ class DBManager(object):
if we_are_on_km3net_gitlab_ci():
if username is not None and password is not None:
self.login(username, password)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment