Skip to content

Commit dd3d7f6

Browse files
authored
Merge pull request #960 from Vafilor/feat/new.cvat
feat: cvat 1.6.0 workspace migration
2 parents 09b854a + 4d1aff5 commit dd3d7f6

File tree

3 files changed

+172
-0
lines changed

3 files changed

+172
-0
lines changed

db/go/20211028205201_cvat_1_6.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package migration
2+
3+
import (
4+
"database/sql"
5+
"github.com/pressly/goose"
6+
"path/filepath"
7+
)
8+
9+
func initialize20211028205201() {
10+
if _, ok := initializedMigrations[20211028205201]; !ok {
11+
goose.AddMigration(Up20211028205201, Down20211028205201)
12+
initializedMigrations[20211028205201] = true
13+
}
14+
}
15+
16+
// Up20211028205201 creates the new cvat 1.6.0 workspace template
17+
func Up20211028205201(tx *sql.Tx) error {
18+
// This code is executed when the migration is applied.
19+
return createWorkspaceTemplate(
20+
filepath.Join("workspaces", "cvat_1_6_0", "20211028205201.yaml"),
21+
"CVAT_1.6.0",
22+
"Powerful and efficient Computer Vision Annotation Tool (CVAT)")
23+
}
24+
25+
// Down20211028205201 archives the new cvat 1.6.0 workspace template
26+
func Down20211028205201(tx *sql.Tx) error {
27+
return archiveWorkspaceTemplate("CVAT_1.6.0")
28+
}

db/go/db.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func Initialize() {
9696
initialize20210329194731()
9797
initialize20210414165510()
9898
initialize20210719190719()
99+
initialize20211028205201()
99100

100101
if err := client.DB.Close(); err != nil {
101102
log.Printf("[error] closing db %v", err)
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
metadata:
2+
name: CVAT
3+
kind: Workspace
4+
version: 20211028205201
5+
action: create
6+
description: "Powerful and efficient Computer Vision Annotation Tool (CVAT 1.6.0)"
7+
spec:
8+
containers:
9+
- name: cvat-db
10+
image: postgres:10-alpine
11+
env:
12+
- name: POSTGRES_USER
13+
value: root
14+
- name: POSTGRES_DB
15+
value: cvat
16+
- name: POSTGRES_HOST_AUTH_METHOD
17+
value: trust
18+
- name: PGDATA
19+
value: /var/lib/psql/data
20+
ports:
21+
- containerPort: 5432
22+
name: tcp
23+
volumeMounts:
24+
- name: db
25+
mountPath: /var/lib/psql
26+
- name: cvat-redis
27+
image: redis:4.0-alpine
28+
ports:
29+
- containerPort: 6379
30+
name: tcp
31+
- name: cvat
32+
image: onepanel/cvat:v1.0.2_cvat.1.6.0
33+
env:
34+
- name: DJANGO_MODWSGI_EXTRA_ARGS
35+
value: ""
36+
- name: ALLOWED_HOSTS
37+
value: '*'
38+
- name: CVAT_REDIS_HOST
39+
value: localhost
40+
- name: CVAT_POSTGRES_HOST
41+
value: localhost
42+
- name: CVAT_SHARE_URL
43+
value: /cvat/data
44+
- name: CVAT_SHARE_DIR
45+
value: /share
46+
- name: CVAT_DATA_DIR
47+
value: /cvat/data
48+
- name: CVAT_MEDIA_DATA_DIR
49+
value: /cvat/data/data
50+
- name: CVAT_KEYS_DIR
51+
value: /cvat/data/keys
52+
- name: CVAT_MODELS_DIR
53+
value: /cvat/data/models
54+
- name: CVAT_LOGS_DIR
55+
value: /cvat/logs
56+
- name: CVAT_ANNOTATIONS_OBJECT_STORAGE_PREFIX
57+
value: 'artifacts/$(ONEPANEL_RESOURCE_NAMESPACE)/annotations/'
58+
- name: CVAT_ONEPANEL_WORKFLOWS_LABEL
59+
value: 'key=used-by,value=cvat'
60+
- name: NVIDIA_VISIBLE_DEVICES
61+
value: all
62+
- name: NVIDIA_DRIVER_CAPABILITIES
63+
value: compute,utility
64+
- name: NVIDIA_REQUIRE_CUDA
65+
value: "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
66+
- name: ONEPANEL_MAIN_CONTAINER
67+
value: 'true'
68+
- name: CVAT_SERVERLESS
69+
value: True
70+
ports:
71+
- containerPort: 8080
72+
name: http
73+
volumeMounts:
74+
- name: cvat-data
75+
mountPath: /cvat
76+
- name: share
77+
mountPath: /share
78+
- name: sys-namespace-config
79+
mountPath: /etc/onepanel
80+
readOnly: true
81+
- name: cvat-ui
82+
image: onepanel/cvat-ui:v1.0.2_cvat.1.6.0
83+
ports:
84+
- containerPort: 80
85+
name: http
86+
- name: sys-filesyncer
87+
image: onepanel/filesyncer:v1.0.0
88+
imagePullPolicy: Always
89+
args:
90+
- server
91+
- -server-prefix=/sys/filesyncer
92+
volumeMounts:
93+
- name: share
94+
mountPath: /share
95+
- name: sys-namespace-config
96+
mountPath: /etc/onepanel
97+
readOnly: true
98+
ports:
99+
- name: cvat-ui
100+
port: 80
101+
protocol: TCP
102+
targetPort: 80
103+
- name: cvat
104+
port: 8080
105+
protocol: TCP
106+
targetPort: 8080
107+
- name: fs
108+
port: 8888
109+
protocol: TCP
110+
targetPort: 8888
111+
routes:
112+
- match:
113+
- uri:
114+
prefix: /sys/filesyncer
115+
route:
116+
- destination:
117+
port:
118+
number: 8888
119+
- match:
120+
- uri:
121+
regex: \/?api.*|\/?git.*|\/?tensorflow.*|\/?onepanelio.*|\/?tracking.*|\/?auto_annotation.*|\/?analytics.*|\/?static.*|\/?admin.*|\/?documentation.*|\/?dextr.*|\/?reid.*|\/?django-rq.*
122+
- queryParams:
123+
id:
124+
regex: \d+.*
125+
route:
126+
- destination:
127+
port:
128+
number: 8080
129+
- match:
130+
- uri:
131+
prefix: /
132+
route:
133+
- destination:
134+
port:
135+
number: 80
136+
volumeClaimTemplates:
137+
- metadata:
138+
name: db
139+
spec:
140+
accessModes: [ "ReadWriteOnce" ]
141+
resources:
142+
requests:
143+
storage: 20Gi

0 commit comments

Comments
 (0)