Bug 1319929 - Unable to create new Jobs from a template [NEEDINFO]
Summary: Unable to create new Jobs from a template
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Maciej Szulik
QA Contact: DeShuai Ma
Depends On:
TreeView+ depends on / blocked
Reported: 2016-03-21 20:49 UTC by Ed Seymour
Modified: 2017-03-08 18:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Jobs were experimental feature in 3.1. Consequence: Templates didn't work with Jobs. Fix: Stabilize Job feature. Result: Jobs migrated to stable API allowing us to fully support all the necessary features, including Templates.
Clone Of:
Last Closed: 2016-09-27 09:36:46 UTC
Target Upstream Version:
maszulik: needinfo? (eseymour)

Attachments (Terms of Use)
Example template using a Job (1.28 KB, text/plain)
2016-03-22 13:03 UTC, Ed Seymour
no flags Details

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1933 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.3 Release Advisory 2016-09-27 13:24:36 UTC

Description Ed Seymour 2016-03-21 20:49:35 UTC
Description of problem:
Create a template to provision a new Job (extensions/v1beta1) reports an "unknown type Job" error message when used. 
Use case was to create templates to run one-time jobs on demand with parallelism and completion, such as a bench mark test. 

Version-Release number of selected component (if applicable):
CDK version beta5

How reproducible: easy

Steps to Reproduce:
1. Create a template for a Job
2. Use 'Add to Project' to request an instance of Job

Actual results:
Reported error 'unknown type Job'

Expected results:
It should create Job. Note: Jobs can be successfully created without using templates. 

Additional info:

Comment 1 Brenton Leanhardt 2016-03-21 21:01:54 UTC
Apologies in advance if I'm triaging this incorrectly.

Comment 2 Andy Goldstein 2016-03-21 21:03:09 UTC
Could you please attach your template?

Comment 3 Ed Seymour 2016-03-22 13:03:55 UTC
Created attachment 1139070 [details]
Example template using a Job

Attached is an example template that attempts to create a new resource of typeJob

Comment 4 Andy Goldstein 2016-03-22 13:19:34 UTC
What openshift version are you running? I tested the latest master and it worked for me, albeit with a couple of required changes to your template. I had to set parallelism and completions to hard-coded int values instead of parameters, because the parameters turn into strings, and these values must be ints.

Comment 5 Ed Seymour 2016-03-22 15:30:34 UTC
It was latest CDK beta - that may be why it didn't work, perhaps?

Comment 6 Andy Goldstein 2016-03-22 15:33:03 UTC
What is the output of running this command? `openshift version`

Comment 7 Ed Seymour 2016-03-22 17:00:17 UTC
openshift v3.1.0.4-16-g112fcc4
kubernetes v1.1.0-origin-1107-g4c8e6f4
etcd 2.1.2

Comment 8 Andy Goldstein 2016-03-22 20:38:22 UTC
Maciej, are jobs supposed to work in I know they work in 3.2...

Comment 9 Ed Seymour 2016-03-23 16:57:55 UTC
To be clear, the Job works when not part of a template, it's only when I tried to template the Job that I hit this issue.

Comment 10 Maciej Szulik 2016-03-23 21:43:53 UTC
Ed, that might be crucial information. Will look into this tomorrow morning.

Comment 11 Maciej Szulik 2016-03-24 14:02:57 UTC
Jobs in 3.1 where only available if you specified to enable experimental API, but since you're mentioning plain Jobs work ok I assume you have that on, on the other hand 'unknown type Job' suggests it's not on.
Additionally between 3.1 and 3.2 there were more significant changes in how API is registered, it might be that templates don't work well with those, or rather didn't work well with experimental APIs. Can you verify if running cli version works for you:

oc process -f template.yaml -v URL=google.pl | oc create -f -

Comment 12 Maciej Szulik 2016-06-28 14:08:19 UTC
Checked against latest master, it's working correctly. Moving to QA.

Comment 13 Weihua Meng 2016-06-29 08:19:00 UTC
Jobs can be successfully created using templates. 
# oc process -f template.yaml -v URL=google.pl | oc create -f -
job "ab" created
# oc get job
ab        1         0            40s

# openshift version
openshift v3.2.1.3-1-gcbaf600
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5

Comment 14 Trevor McKay 2016-07-14 16:02:27 UTC
fyi, I can verify that this was broken in 3.1 but appears to have been fixed later.

# oc version
oc v3.1.0.4-5-gebe80f5
kubernetes v1.1.0-origin-1107-g4c8e6f4

In my case, a yaml template containing a job could be launched from the CLI using oc process and running oc create on the resulting json.

However, if I uploaded the yaml template to a project via oc create and then tried to launch from the console via "Add to project", it failed with an unknown kind error.

note, using origin image tags from https://hub.docker.com/r/openshift/origin/tags/ and running allinone containers, this appears to have been fixed in v1.1.2 but was broken previously.

Comment 16 errata-xmlrpc 2016-09-27 09:36:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.