mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-09-27 01:56:03 +08:00
39 lines
1.0 KiB
Go
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",
|
|
},
|
|
)
|
|
}
|