open-nomad/api
Seth Hoenig ba728f8f97
api: enable support for setting original job source (#16763)
* api: enable support for setting original source alongside job

This PR adds support for setting job source material along with
the registration of a job.

This includes a new HTTP endpoint and a new RPC endpoint for
making queries for the original source of a job. The
HTTP endpoint is /v1/job/<id>/submission?version=<version> and
the RPC method is Job.GetJobSubmission.

The job source (if submitted, and doing so is always optional), is
stored in the job_submission memdb table, separately from the
actual job. This way we do not incur overhead of reading the large
string field throughout normal job operations.

The server config now includes job_max_source_size for configuring
the maximum size the job source may be, before the server simply
drops the source material. This should help prevent Bad Things from
happening when huge jobs are submitted. If the value is set to 0,
all job source material will be dropped.

* api: avoid writing var content to disk for parsing

* api: move submission validation into RPC layer

* api: return an error if updating a job submission without namespace or job id

* api: be exact about the job index we associate a submission with (modify)

* api: reword api docs scheduling

* api: prune all but the last 6 job submissions

* api: protect against nil job submission in job validation

* api: set max job source size in test server

* api: fixups from pr
2023-04-11 08:45:08 -05:00
..
contexts [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
internal/testutil [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
acl.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
acl_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
agent.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
agent_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
allocations.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
allocations_exec.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
allocations_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
api.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
api_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
compose_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
constraint.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
constraint_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
consul_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
csi.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
csi_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
deployments.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
evaluations.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
evaluations_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
event_stream.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
event_stream_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
fs.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
fs_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
go.mod client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672) 2023-03-28 08:27:58 -05:00
go.sum client/fingerprint: correctly fingerprint E/P cores of Apple Silicon chips (#16672) 2023-03-28 08:27:58 -05:00
ioutil.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
ioutil_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
jobs.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
jobs_test.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
keyring.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
keyring_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
namespace.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
namespace_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
node_meta.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
node_meta_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
nodes.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
nodes_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
operator.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
operator_autopilot.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
operator_ent_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
operator_metrics.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
operator_metrics_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
operator_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
quota.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
quota_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
raw.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
recommendations.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
regions.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
regions_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
resources.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
resources_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
scaling.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
scaling_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
search.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
search_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
sentinel.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
sentinel_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
services.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
services_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
status.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
status_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
system.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
system_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
tasks.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
tasks_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
util_test.go api: enable support for setting original job source (#16763) 2023-04-11 08:45:08 -05:00
utils.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
utils_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
variables.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
variables_test.go [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00