43
43
jobs :
44
44
setup :
45
45
runs-on : self-hosted
46
- outputs :
47
- rc_tag : ${{ github.event.inputs.rc_tag }}
48
- container_tag : ${{ github.event.inputs.container_tag }}
49
46
steps :
50
47
- name : Checkout repository
51
48
uses : actions/checkout@v4
52
49
53
50
- name : Set up environment
54
51
uses : ./.github/actions/setup-environment-action
55
52
with :
56
- go-version : default, otherwise remove if default is 1.21
53
+ go-version : default
57
54
58
55
- name : Fetch Go SDK RC and Tidy Modules
59
56
working-directory : ./sdks/go/examples/wordcount
60
57
run : |
61
58
go get -d github.com/apache/beam/sdks/v2@${{ github.event.inputs.rc_tag }}
62
59
go mod tidy
63
60
64
- # Cache Go modules to speed up subsequent jobs
65
- - name : Cache Go modules
66
- uses : actions/cache@v4
67
- with :
68
- path : |
69
- ~/.cache/go-build
70
- ~/go/pkg/mod
71
- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
72
- restore-keys : |
73
- ${{ runner.os }}-go-
74
61
75
62
validate-go-rc-prism :
76
63
needs : setup
84
71
with :
85
72
go-version : default
86
73
87
- # Restore cached Go modules
88
- - name : Restore Go modules cache
89
- uses : actions/cache@v4
90
- with :
91
- path : |
92
- ~/.cache/go-build
93
- ~/go/pkg/mod
94
- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
95
- restore-keys : |
96
- ${{ runner.os }}-go-
97
74
98
75
# Assuming gcloud/gsutil is available and authenticated on the self-hosted runner
99
76
- name : Download Input File from GCS (Prism)
108
85
--output ./output_prism.txt \
109
86
--runner=PrismRunner \
110
87
--environment_type=DOCKER \
111
- --environment_config=apache/beam_go_sdk:${{ needs.setup.outputs .container_tag }}
88
+ --environment_config=apache/beam_go_sdk:${{ github.event.inputs .container_tag }}
112
89
113
90
- name : Check output file
114
91
working-directory : ./sdks/go/examples/wordcount
@@ -136,23 +113,13 @@ jobs:
136
113
with :
137
114
go-version : default
138
115
139
- # Restore cached Go modules
140
- - name : Restore Go modules cache
141
- uses : actions/cache@v4
142
- with :
143
- path : |
144
- ~/.cache/go-build
145
- ~/go/pkg/mod
146
- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
147
- restore-keys : |
148
- ${{ runner.os }}-go-
149
116
150
117
# Assuming gcloud is available and authenticated on the self-hosted runner
151
118
- name : Run Go WordCount with DataflowRunner
152
119
working-directory : ./sdks/go/examples/wordcount
153
120
env :
154
121
# Define output path based on constant prefix and RC tag for uniqueness
155
- GCS_OUTPUT_PATH : ${{ env.GCS_OUTPUT_PREFIX }}/${{ needs.setup.outputs .rc_tag }}/dataflow/output
122
+ GCS_OUTPUT_PATH : ${{ env.GCS_OUTPUT_PREFIX }}/${{ github.event.inputs .rc_tag }}/dataflow/output
156
123
run : |
157
124
echo "Using output path: $GCS_OUTPUT_PATH"
158
125
go run wordcount.go \
@@ -163,10 +130,10 @@ jobs:
163
130
--region=${{ env.GCP_REGION }} \
164
131
--temp_location=${{ env.GCS_TEMP_LOCATION }} \
165
132
--environment_type=DOCKER \
166
- --environment_config=apache/beam_go_sdk:${{ needs.setup.outputs .container_tag }}
133
+ --environment_config=apache/beam_go_sdk:${{ github.event.inputs .container_tag }}
167
134
168
135
# Note: Checking Dataflow output requires gcloud storage commands and depends on job completion.
169
136
# This basic workflow focuses on submission. A more robust check would poll the job status
170
137
# and then verify GCS output, which is significantly more complex.
171
138
- name : Log Dataflow Job Submission Info
172
- run : echo "Dataflow job submitted. Check GCP console (project ${{ env.GCP_PROJECT_ID }}) for status and output at ${{ env.GCS_OUTPUT_PREFIX }}/${{ needs.setup.outputs .rc_tag }}/dataflow/output"
139
+ run : echo "Dataflow job submitted. Check GCP console (project ${{ env.GCP_PROJECT_ID }}) for status and output at ${{ env.GCS_OUTPUT_PREFIX }}/${{ github.event.inputs .rc_tag }}/dataflow/output"
0 commit comments