Files
onepanel/db/go/20201209124226_update_tensorflow_training.go
Andrey Melnikov ca5f602738 fix: separated workflow templates and workspace templates for yaml resources for migrations.
Also updated migration yamls to the latest based on templates repo.
2020-12-25 16:32:15 -08:00

39 lines
1.0 KiB
Go

package migration
import (
"database/sql"
"github.com/pressly/goose"
"path/filepath"
)
func initialize20201209124226() {
if _, ok := initializedMigrations[20201209124226]; !ok {
goose.AddMigration(Up20201209124226, Down20201209124226)
initializedMigrations[20201209124226] = true
}
}
// Up20201209124226 updates the tensorflow workflow
func Up20201209124226(tx *sql.Tx) error {
// This code is executed when the migration is applied.
return updateWorkflowTemplateManifest(
filepath.Join("workflows", "tensorflow-mnist-training", "20201209124226.yaml"),
tensorflowWorkflowTemplateName,
map[string]string{
"framework": "tensorflow",
},
)
}
// Down20201209124226 rolls back the tensorflow workflow
func Down20201209124226(tx *sql.Tx) error {
// This code is executed when the migration is rolled back.
return updateWorkflowTemplateManifest(
filepath.Join("workflows", "tensorflow-mnist-training", "20200605090535.yaml"),
tensorflowWorkflowTemplateName,
map[string]string{
"framework": "tensorflow",
},
)
}