Skip to content

Commit

Permalink
Make Language jobs use Estuary publisher by default (#909)
Browse files Browse the repository at this point in the history
Also remove the Verifier flag which doesn't do anything.
  • Loading branch information
simonwo committed Oct 18, 2022
1 parent 31b12ae commit acbdc3f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 32 deletions.
9 changes: 0 additions & 9 deletions cmd/bacalhau/run_python.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

"github.com/c2h5oh/datasize"
"github.com/filecoin-project/bacalhau/pkg/job"
"github.com/filecoin-project/bacalhau/pkg/model"
"github.com/filecoin-project/bacalhau/pkg/system"
"github.com/filecoin-project/bacalhau/pkg/util/templates"
"github.com/rs/zerolog/log"
Expand All @@ -37,7 +36,6 @@ const maximumContextSize datasize.ByteSize = 10 * datasize.MB
// LanguageRunOptions declares the arguments accepted by the `'language' run` command
type LanguageRunOptions struct {
Deterministic bool // Execute this job deterministically
Verifier string // Verifier - verifier.Verifier
Inputs []string // Array of input CIDs
InputUrls []string // Array of input URLs (will be copied to IPFS)
InputVolumes []string // Array of input volumes in 'CID:mount point' form
Expand Down Expand Up @@ -69,7 +67,6 @@ type LanguageRunOptions struct {
func NewLanguageRunOptions() *LanguageRunOptions {
return &LanguageRunOptions{
Deterministic: true,
Verifier: "ipfs",
Inputs: []string{},
InputUrls: []string{},
InputVolumes: []string{},
Expand Down Expand Up @@ -136,11 +133,6 @@ func init() {
"Path to context (e.g. python code) to send to server (via public IPFS network) "+
"for execution (max 10MiB). Set to empty string to disable",
)
runPythonCmd.PersistentFlags().StringVar(
&OLR.Verifier, "verifier", OLR.Verifier,
`What verification engine to use to run the job`,
)

runPythonCmd.PersistentFlags().StringSliceVarP(
&OLR.Labels, "labels", "l", OLR.Labels,
`List of labels for the job. Enter multiple in the format '-l a -l 2'. All characters not matching /a-zA-Z0-9_:|-/ and all emojis will be stripped.`, //nolint:lll // Documentation, ok if long.
Expand Down Expand Up @@ -197,7 +189,6 @@ func SubmitLanguageJob(cmd *cobra.Command, ctx context.Context, language, versio
//nolint:lll // it's ok to be long
// TODO: #450 These two code paths make me nervous - the fact that we have ConstructLanguageJob and ConstructDockerJob as separate means manually keeping them in sync.
j, err := job.ConstructLanguageJob(
model.APIVersionLatest(),
OLR.InputVolumes,
OLR.InputUrls,
OLR.OutputVolumes,
Expand Down
37 changes: 15 additions & 22 deletions pkg/job/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ func ConstructDockerJob( //nolint:funlen
}

func ConstructLanguageJob(
a model.APIVersion,
inputVolumes []string,
inputUrls []string,
outputVolumes []string,
Expand Down Expand Up @@ -201,28 +200,22 @@ func ConstructLanguageJob(
if err != nil {
return &model.Job{}, err
}
j.APIVersion = a.String()

j.Spec = model.Spec{
Engine: model.EngineLanguage,
Verifier: model.VerifierNoop,
// TODO: should this always be ipfs?
Publisher: model.PublisherIpfs,
Language: model.JobSpecLanguage{
Language: language,
LanguageVersion: languageVersion,
Deterministic: deterministic,
Context: model.StorageSpec{},
Command: command,
ProgramPath: programPath,
RequirementsPath: requirementsPath,
},
Inputs: jobInputs,
Contexts: jobContexts,
Outputs: jobOutputs,
Annotations: jobAnnotations,
DoNotTrack: doNotTrack,
}
j.Spec.Engine = model.EngineLanguage
j.Spec.Language = model.JobSpecLanguage{
Language: language,
LanguageVersion: languageVersion,
Deterministic: deterministic,
Context: model.StorageSpec{},
Command: command,
ProgramPath: programPath,
RequirementsPath: requirementsPath,
}
j.Spec.Inputs = jobInputs
j.Spec.Contexts = jobContexts
j.Spec.Outputs = jobOutputs
j.Spec.Annotations = jobAnnotations
j.Spec.DoNotTrack = doNotTrack

j.Deal = model.Deal{
Concurrency: concurrency,
Expand Down
2 changes: 1 addition & 1 deletion pkg/model/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewJob() *Job {
func NewJobWithSaneProductionDefaults() (*Job, error) {
j := NewJob()
err := mergo.Merge(j, &Job{
APIVersion: V1alpha1.String(),
APIVersion: APIVersionLatest().String(),
Spec: Spec{
Engine: EngineDocker,
Verifier: VerifierNoop,
Expand Down

0 comments on commit acbdc3f

Please sign in to comment.