Skip to content

Commit 27ccc01

Browse files
Change datatypes for annotation2 and hopannotation2 (#420)
* Update annotation2 and hopannotation2 * Process staging in staging to verify pipeline before production
1 parent 68e819d commit 27ccc01

File tree

6 files changed

+25
-17
lines changed

6 files changed

+25
-17
lines changed

apply-cluster.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ CLUSTER=${CLOUDSDK_CONTAINER_CLUSTER:?Please provide cluster name: $USAGE}
1818
DATE_SKIP=${DATE_SKIP:-"0"} # Number of dates to skip between each processed date (for sandbox).
1919
TASK_FILE_SKIP=${TASK_FILE_SKIP:-"0"} # Number of files to skip between each processed file (for sandbox).
2020

21-
# Use sandbox in sandbox, measurement-lab in staging and oti.
21+
# Use sandbox in sandbox, staging in staging, measurement-lab in oti.
2222
SOURCE_PROJECT=${PROJECT_ID/mlab-oti/measurement-lab}
23-
SOURCE_PROJECT=${SOURCE_PROJECT/mlab-staging/measurement-lab}
23+
# TODO(soltesz): restore or remove.
24+
#SOURCE_PROJECT=${SOURCE_PROJECT/mlab-staging/measurement-lab}
2425
sed -i \
2526
-e 's/{{ANNOTATION_SOURCE_PROJECT}}/'${SOURCE_PROJECT}'/g' \
2627
config/config.yml

cloud/bq/ops.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ func NewTableOpsWithClient(client bqiface.Client, job tracker.Job, project strin
5151
switch job.Datatype {
5252
case "switch":
5353
fallthrough
54-
case "annotation":
54+
case "annotation2":
5555
fallthrough
56-
case "hopannotation1":
56+
case "hopannotation2":
5757
fallthrough
5858
case "pcap":
5959
fallthrough
@@ -176,7 +176,7 @@ const tmpTable = "`{{.Project}}.{{.Job.Datasets.Tmp}}.{{.Job.Datatype}}`"
176176
const rawTable = "`{{.Project}}.{{.Job.Datasets.Raw}}.{{.Job.Datatype}}`"
177177

178178
// NOTE: experiment annotations must come from the same raw experiment dataset.
179-
const annoTable = "`{{.Project}}.{{.Job.Datasets.Raw}}.annotation`"
179+
const annoTable = "`{{.Project}}.{{.Job.Datasets.Raw}}.annotation2`"
180180

181181
var dedupTemplate = template.Must(template.New("").Parse(`
182182
#standardSQL

cloud/bq/ops_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
)
1818

1919
func TestTemplate(t *testing.T) {
20-
job := jobtest.NewJob("bucket", "ndt", "annotation", time.Date(2019, 3, 4, 0, 0, 0, 0, time.UTC))
20+
job := jobtest.NewJob("bucket", "ndt", "annotation2", time.Date(2019, 3, 4, 0, 0, 0, 0, time.UTC))
2121
q, err := bq.NewTableOps(context.Background(), job, "fake-project", "")
2222
rtx.Must(err, "NewTableOps failed")
2323
qs := bq.DedupQuery(*q)
@@ -45,7 +45,7 @@ func TestValidateQueries(t *testing.T) {
4545
{
4646
Bucket: "bucket",
4747
Experiment: "ndt",
48-
Datatype: "annotation",
48+
Datatype: "annotation2",
4949
Date: d,
5050
Datasets: tracker.Datasets{Tmp: "tmp_ndt", Raw: "raw_ndt"},
5151
},
@@ -66,7 +66,7 @@ func TestValidateQueries(t *testing.T) {
6666
{
6767
Bucket: "bucket",
6868
Experiment: "ndt",
69-
Datatype: "hopannotation1",
69+
Datatype: "hopannotation2",
7070
Date: d,
7171
Datasets: tracker.Datasets{Tmp: "tmp_ndt", Raw: "raw_ndt"},
7272
},

config/config.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@ sources:
88
# NOTE: It now matters what order these are in.
99
- bucket: archive-{{ANNOTATION_SOURCE_PROJECT}}
1010
experiment: ndt
11-
datatype: annotation
11+
datatype: annotation2
1212
target_datasets:
1313
tmp: tmp_ndt
1414
raw: raw_ndt
15+
daily_only: true
1516
- bucket: archive-{{NDT_SOURCE_PROJECT}}
1617
experiment: ndt
1718
datatype: ndt5
1819
target_datasets:
1920
tmp: tmp_ndt
2021
raw: raw_ndt
2122
join: ndt
23+
daily_only: true
2224
- bucket: archive-{{NDT_SOURCE_PROJECT}}
2325
experiment: ndt
2426
datatype: ndt7
2527
target_datasets:
2628
tmp: tmp_ndt
2729
raw: raw_ndt
2830
join: ndt
31+
daily_only: true
2932
- bucket: archive-{{NDT_SOURCE_PROJECT}}
3033
experiment: ndt
3134
datatype: pcap
@@ -35,27 +38,31 @@ sources:
3538
daily_only: true
3639
- bucket: archive-{{ANNOTATION_SOURCE_PROJECT}}
3740
experiment: ndt
38-
datatype: hopannotation1
41+
datatype: hopannotation2
3942
target_datasets:
4043
tmp: tmp_ndt
4144
raw: raw_ndt
45+
daily_only: true
4246
- bucket: archive-measurement-lab
4347
experiment: ndt
4448
datatype: scamper1
4549
target_datasets:
4650
tmp: tmp_ndt
4751
raw: raw_ndt
4852
join: ndt
53+
daily_only: true
4954
- bucket: archive-measurement-lab
5055
experiment: utilization
5156
datatype: switch
5257
target_datasets:
5358
tmp: tmp_utilization
5459
raw: raw_utilization
60+
daily_only: true
5561
- bucket: archive-{{NDT_SOURCE_PROJECT}}
5662
experiment: ndt
5763
datatype: tcpinfo
5864
target_datasets:
5965
tmp: tmp_ndt
6066
raw: raw_ndt
6167
join: ndt
68+
daily_only: true

ops/actions.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ func newStateFunc(detail string) ActionFunc {
3030
// annotation job in the tracker. Used to gate the join action.
3131
func newJoinConditionFunc(tk *tracker.Tracker, detail string) ConditionFunc {
3232
return func(ctx context.Context, j tracker.Job) bool {
33-
if j.Datatype == "annotation" {
33+
if j.Datatype == "annotation2" {
3434
// Annotation does not require joining, so the check is
3535
// not needed.
3636
log.Println(j, "condition met")
3737
return true
3838
}
39-
// All other types currently depend only on the annotation table.
40-
// So, we check whether the annotation table is complete.
39+
// All other types currently depend only on the annotation2 table.
40+
// So, we check whether the annotation2 table is complete.
4141
// (Technically, we only need to know whether the copy has completed.)
4242
ann := j
43-
ann.Datatype = "annotation"
43+
ann.Datatype = "annotation2"
4444
status, err := tk.GetStatus(ann.Key())
4545
if err != nil {
46-
// For early dates, there is no annotation job, so if the job
46+
// For early dates, there is no annotation2 job, so if the job
4747
// is absent, we proceed with the join.
4848
log.Println(ann, "is absent")
4949
return true

ops/actions_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestStandardMonitor(t *testing.T) {
4949
{
5050
Bucket: "bucket",
5151
Experiment: "ndt",
52-
Datatype: "annotation",
52+
Datatype: "annotation2",
5353
Date: d,
5454
Datasets: tracker.Datasets{Tmp: "tmp_ndt", Raw: "raw_ndt"},
5555
},
@@ -63,7 +63,7 @@ func TestStandardMonitor(t *testing.T) {
6363
{
6464
Bucket: "bucket",
6565
Experiment: "ndt",
66-
Datatype: "hopannotation1",
66+
Datatype: "hopannotation2",
6767
Date: d,
6868
Datasets: tracker.Datasets{Tmp: "tmp_ndt", Raw: "raw_ndt"},
6969
},

0 commit comments

Comments
 (0)