@@ -14,8 +14,9 @@ def getEnv(self): return self.getContainer(0)['env']
1414 def getImagePullPolicy (self ): return self .getContainer (0 )['imagePullPolicy' ]
1515
1616
17- def __init__ (self , name , data , filer_name = 'eu.gcr.io/tes-wes/filer' , filer_version = 'v0.5' , pullPolicyAlways = False ):
17+ def __init__ (self , name , data , filer_name = 'eu.gcr.io/tes-wes/filer' , filer_version = 'v0.5' , pullPolicyAlways = False , json_pvc = None ):
1818 self .name = name
19+ self .json_pvc = json_pvc
1920 self .spec = {
2021 "kind" : "Job" ,
2122 "apiVersion" : "batch/v1" ,
@@ -41,11 +42,22 @@ def __init__(self, name, data, filer_name='eu.gcr.io/tes-wes/filer', filer_versi
4142 }
4243
4344 env = self .getEnv ()
44- env .append ({"name" : "JSON_INPUT" , "value" : json .dumps (data )})
45+ if json_pvc is None :
46+ env .append ({"name" : "JSON_INPUT" , "value" : json .dumps (data )})
4547 env .append ({"name" : "HOST_BASE_PATH" , "value" : path .HOST_BASE_PATH })
4648 env .append (
4749 {"name" : "CONTAINER_BASE_PATH" , "value" : path .CONTAINER_BASE_PATH })
4850
51+ if json_pvc :
52+ self .getVolumeMounts ().append ({
53+ "name" : 'jsoninput'
54+ , 'mountPath' : '/jsoninput'
55+ })
56+ self .getVolumes ().append ({
57+ "name" : 'jsoninput'
58+ , "configMap" : { 'name' : json_pvc }
59+ })
60+
4961 if fileEnabled ():
5062 self .getVolumeMounts ().append ({
5163
@@ -152,8 +164,12 @@ def add_netrc_mount(self, netrc_name='netrc'):
152164
153165
154166 def get_spec (self , mode , debug = False ):
155- self .spec ['spec' ]['template' ]['spec' ]['containers' ][0 ]['args' ] = [
156- mode , "$(JSON_INPUT)" ]
167+ if self .json_pvc is None :
168+ self .spec ['spec' ]['template' ]['spec' ]['containers' ][0 ]['args' ] = [
169+ mode , "$(JSON_INPUT)" ]
170+ else :
171+ self .spec ['spec' ]['template' ]['spec' ]['containers' ][0 ]['args' ] = [
172+ mode , "/jsoninput/JSON_INPUT.gz" ]
157173
158174 if debug :
159175 self .spec ['spec' ]['template' ]['spec' ]['containers' ][0 ][
0 commit comments