Skip to content

Commit

Permalink
feat: cvat 1.6.0 workspace migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Vafilor committed Oct 28, 2021
1 parent 493ca51 commit 719613e
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 0 deletions.
26 changes: 26 additions & 0 deletions db/go/20211028205201_cvat_1_6.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package migration

import (
"database/sql"
"github.com/pressly/goose"
"path/filepath"
)

func initialize20211028205201() {
if _, ok := initializedMigrations[20211028205201]; !ok {
goose.AddMigration(Up20211028205201, Down20211028205201)
initializedMigrations[20211028205201] = true
}
}

func Up20211028205201(tx *sql.Tx) error {
// This code is executed when the migration is applied.
return createWorkspaceTemplate(
filepath.Join("workspaces", "cvat_1_6_0", "20211028205201.yaml"),
"CVAT_1.6.0",
"Powerful and efficient Computer Vision Annotation Tool (CVAT)")
}

func Down20211028205201(tx *sql.Tx) error {
return archiveWorkspaceTemplate("CVAT_1.6.0")
}
1 change: 1 addition & 0 deletions db/go/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func Initialize() {
initialize20210329194731()
initialize20210414165510()
initialize20210719190719()
initialize20211028205201()

if err := client.DB.Close(); err != nil {
log.Printf("[error] closing db %v", err)
Expand Down
143 changes: 143 additions & 0 deletions db/yaml/workspaces/cvat_1_6_0/20211028205201.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
metadata:
name: CVAT
kind: Workspace
version: 20211028205201
action: create
description: "Powerful and efficient Computer Vision Annotation Tool (CVAT 1.6.0)"
spec:
containers:
- name: cvat-db
image: postgres:10-alpine
env:
- name: POSTGRES_USER
value: root
- name: POSTGRES_DB
value: cvat
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
- name: PGDATA
value: /var/lib/psql/data
ports:
- containerPort: 5432
name: tcp
volumeMounts:
- name: db
mountPath: /var/lib/psql
- name: cvat-redis
image: redis:4.0-alpine
ports:
- containerPort: 6379
name: tcp
- name: cvat
image: onepanel/cvat:v1.0.2_cvat.1.6.0
env:
- name: DJANGO_MODWSGI_EXTRA_ARGS
value: ""
- name: ALLOWED_HOSTS
value: '*'
- name: CVAT_REDIS_HOST
value: localhost
- name: CVAT_POSTGRES_HOST
value: localhost
- name: CVAT_SHARE_URL
value: /cvat/data
- name: CVAT_SHARE_DIR
value: /share
- name: CVAT_DATA_DIR
value: /cvat/data
- name: CVAT_MEDIA_DATA_DIR
value: /cvat/data/data
- name: CVAT_KEYS_DIR
value: /cvat/data/keys
- name: CVAT_MODELS_DIR
value: /cvat/data/models
- name: CVAT_LOGS_DIR
value: /cvat/logs
- name: CVAT_ANNOTATIONS_OBJECT_STORAGE_PREFIX
value: 'artifacts/$(ONEPANEL_RESOURCE_NAMESPACE)/annotations/'
- name: CVAT_ONEPANEL_WORKFLOWS_LABEL
value: 'key=used-by,value=cvat'
- name: NVIDIA_VISIBLE_DEVICES
value: all
- name: NVIDIA_DRIVER_CAPABILITIES
value: compute,utility
- name: NVIDIA_REQUIRE_CUDA
value: "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
- name: ONEPANEL_MAIN_CONTAINER
value: 'true'
- name: CVAT_SERVERLESS
value: True
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: cvat-data
mountPath: /cvat
- name: share
mountPath: /share
- name: sys-namespace-config
mountPath: /etc/onepanel
readOnly: true
- name: cvat-ui
image: onepanel/cvat-ui:v1.0.2_cvat.1.6.0
ports:
- containerPort: 80
name: http
- name: sys-filesyncer
image: onepanel/filesyncer:v1.0.0
imagePullPolicy: Always
args:
- server
- -server-prefix=/sys/filesyncer
volumeMounts:
- name: share
mountPath: /share
- name: sys-namespace-config
mountPath: /etc/onepanel
readOnly: true
ports:
- name: cvat-ui
port: 80
protocol: TCP
targetPort: 80
- name: cvat
port: 8080
protocol: TCP
targetPort: 8080
- name: fs
port: 8888
protocol: TCP
targetPort: 8888
routes:
- match:
- uri:
prefix: /sys/filesyncer
route:
- destination:
port:
number: 8888
- match:
- uri:
regex: \/?api.*|\/?git.*|\/?tensorflow.*|\/?onepanelio.*|\/?tracking.*|\/?auto_annotation.*|\/?analytics.*|\/?static.*|\/?admin.*|\/?documentation.*|\/?dextr.*|\/?reid.*|\/?django-rq.*
- queryParams:
id:
regex: \d+.*
route:
- destination:
port:
number: 8080
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 80
volumeClaimTemplates:
- metadata:
name: db
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 20Gi

0 comments on commit 719613e

Please sign in to comment.