Skip to content

Commit 34f055a

Browse files
authored
Update the EC2 instance id used to build Linux ARM binary. Closes #325 (#326)
1 parent 47ba5e9 commit 34f055a

File tree

2 files changed

+11
-65
lines changed

2 files changed

+11
-65
lines changed

.github/workflows/buildimage.yml

Lines changed: 11 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ jobs:
6666
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
6767

6868
- name: make clean
69-
working-directory: ./fdw
7069
run: |-
7170
go version
7271
@@ -87,37 +86,7 @@ jobs:
8786

8887
make clean
8988

90-
# - name: make clean
91-
# run: make clean
92-
# working-directory: ./fdw
93-
94-
- name: make go
95-
working-directory: ./fdw
96-
run: |-
97-
go version
98-
99-
which pg_config
100-
pg_config --version
101-
102-
export PATH=$(pg_config --bindir):$PATH
103-
export PGXS=$(pg_config --pgxs)
104-
105-
export SERVER_LIB=$(pg_config --includedir)/server
106-
export INTERNAL_LIB=$(pg_config --includedir)/internal
107-
108-
export CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
109-
export PG_CFLAGS="$(pg_config --cflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
110-
111-
export CPPFLAGS="$(pg_config --cppflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
112-
export PG_CPPFLAGS="$(pg_config --cppflags) -I${SERVER_LIB} -I${INTERNAL_LIB} -g"
113-
114-
export LDFLAGS=$(pg_config --ldflags)
115-
export PG_LDFLAGS=$(pg_config --ldflags)
116-
117-
make go
118-
11989
- name: make
120-
working-directory: ./fdw
12190
run: |-
12291
go version
12392
@@ -140,15 +109,14 @@ jobs:
140109

141110
- name: gzip the steampipe_postgres_fdw.so
142111
run: |-
143-
gzip steampipe_postgres_fdw.so
144-
mv steampipe_postgres_fdw.so.gz steampipe_postgres_fdw.so.darwin_amd64.gz
145-
working-directory: ./fdw
112+
gzip build-Darwin/steampipe_postgres_fdw.so
113+
mv build-Darwin/steampipe_postgres_fdw.so.gz build-Darwin/steampipe_postgres_fdw.so.darwin_amd64.gz
146114
147115
- name: Save MacOS Build Artifact - AMD64
148116
uses: actions/upload-artifact@v3
149117
with:
150118
name: steampipe_postgres_fdw.so.darwin_amd64
151-
path: ./fdw/steampipe_postgres_fdw.so.darwin_amd64.gz
119+
path: build-Darwin/steampipe_postgres_fdw.so.darwin_amd64.gz
152120
if-no-files-found: error
153121

154122
- name: Save steampipe_postgres_fdw.control # only need this once for ALL platforms
@@ -230,32 +198,24 @@ jobs:
230198
ls -la $INTERNAL_LIB
231199

232200
- name: make clean
233-
working-directory: ./fdw
234201
run: |-
235202
go version
236203
make clean
237204
238-
- name: make go
239-
working-directory: ./fdw
240-
run: |-
241-
make go
242-
243205
- name: make
244-
working-directory: ./fdw
245206
run: |-
246207
make
247208
248209
- name: gzip the steampipe_postgres_fdw.so
249210
run: |-
250-
gzip steampipe_postgres_fdw.so
251-
mv steampipe_postgres_fdw.so.gz steampipe_postgres_fdw.so.linux_amd64.gz
252-
working-directory: ./fdw
211+
gzip build-Linux/steampipe_postgres_fdw.so
212+
mv build-Linux/steampipe_postgres_fdw.so.gz build-Linux/steampipe_postgres_fdw.so.linux_amd64.gz
253213
254214
- name: Save Linux Build Artifact - AMD64
255215
uses: actions/upload-artifact@v3
256216
with:
257217
name: steampipe_postgres_fdw.so.linux_amd64
258-
path: ./fdw/steampipe_postgres_fdw.so.linux_amd64.gz
218+
path: build-Linux/steampipe_postgres_fdw.so.linux_amd64.gz
259219
if-no-files-found: error
260220

261221
build-linux-arm:
@@ -294,21 +254,21 @@ jobs:
294254
aws ec2 authorize-security-group-ingress --group-name pskr-sg --protocol tcp --port 22 --cidr $ip/32 --region ap-south-1
295255
296256
#start instance
297-
aws ec2 start-instances --instance-ids i-059a0baa5fb90a263 --region ap-south-1 --output text
257+
aws ec2 start-instances --instance-ids i-05f5bb2b09b313386 --region ap-south-1 --output text
298258
echo "starting instance..."
299259
sleep 60
300260
301261
# get the public ip and status of the instance
302-
public_ip=$(aws ec2 describe-instances --instance-ids i-059a0baa5fb90a263 --query 'Reservations[*].Instances[*].PublicDnsName' --region ap-south-1 --output text)
303-
status=$(aws ec2 describe-instance-status --instance-ids i-059a0baa5fb90a263 --query 'InstanceStatuses[*].InstanceState.Name' --region ap-south-1 --output text)
262+
public_ip=$(aws ec2 describe-instances --instance-ids i-05f5bb2b09b313386 --query 'Reservations[*].Instances[*].PublicDnsName' --region ap-south-1 --output text)
263+
status=$(aws ec2 describe-instance-status --instance-ids i-05f5bb2b09b313386 --query 'InstanceStatuses[*].InstanceState.Name' --region ap-south-1 --output text)
304264
echo $public_ip
305265
echo $status
306266
307267
# check if the instance is available for use, if not, then wait for it
308268
while [ $status != "running" ] ; do
309269
echo "instance not yet available"
310270
sleep 5
311-
status=$(aws ec2 describe-instance-status --instance-ids i-059a0baa5fb90a263 --query 'InstanceStatuses[*].InstanceState.Name' --region ap-south-1 --output text)
271+
status=$(aws ec2 describe-instance-status --instance-ids i-05f5bb2b09b313386 --query 'InstanceStatuses[*].InstanceState.Name' --region ap-south-1 --output text)
312272
done
313273
314274
# set up the private key
@@ -321,7 +281,7 @@ jobs:
321281
scp -i private_key ubuntu@$public_ip:/home/ubuntu/steampipe-postgres-fdw/build-Linux/steampipe_postgres_fdw.so .
322282
323283
# stop instance
324-
aws ec2 stop-instances --instance-ids i-059a0baa5fb90a263 --region ap-south-1
284+
aws ec2 stop-instances --instance-ids i-05f5bb2b09b313386 --region ap-south-1
325285
326286
# remove the ip from the security group
327287
aws ec2 revoke-security-group-ingress --group-name pskr-sg --protocol tcp --port 22 --cidr $ip/32 --region ap-south-1

scripts/build_binary.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)