Skip to content

Commit 8161d8d

Browse files
kimerinngrishick
andauthored
13758: SSH control host port setting not used when tunneling (#14295)
* 13758: ssh port fixed * 13758: version updated * 13758: changelog updated * 13758: merge fix * 13758: docker image version updated * 13758: docker image version updated * 13758: docker image version updated as deployment was unsuccesful Co-authored-by: Greg Solovyev <[email protected]>
1 parent 79a54a8 commit 8161d8d

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

airbyte-integrations/bases/base-normalization/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ WORKDIR /airbyte
2828
ENV AIRBYTE_ENTRYPOINT "/airbyte/entrypoint.sh"
2929
ENTRYPOINT ["/airbyte/entrypoint.sh"]
3030

31-
LABEL io.airbyte.version=0.2.14
31+
LABEL io.airbyte.version=0.2.16
3232
LABEL io.airbyte.name=airbyte/normalization

airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunnerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public class NormalizationRunnerFactory {
1515

1616
public static final String BASE_NORMALIZATION_IMAGE_NAME = "airbyte/normalization";
17-
public static final String NORMALIZATION_VERSION = "0.2.14";
17+
public static final String NORMALIZATION_VERSION = "0.2.16";
1818

1919
static final Map<String, ImmutablePair<String, DefaultNormalizationRunner.DestinationType>> NORMALIZATION_MAPPING =
2020
ImmutableMap.<String, ImmutablePair<String, DefaultNormalizationRunner.DestinationType>>builder()

airbyte-workers/src/main/resources/sshtunneling.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function openssh() {
2323
tunnel_method=$(cat $1 | jq -r '.tunnel_map.tunnel_method' | tr '[:lower:]' '[:upper:]')
2424
tunnel_username=$(cat $1 | jq -r '.tunnel_map.tunnel_user')
2525
tunnel_host=$(cat $1 | jq -r '.tunnel_map.tunnel_host')
26+
tunnel_port=$(cat $1 | jq -r '.tunnel_map.tunnel_port')
2627
tunnel_local_port=$(cat $1 | jq -r '.local_port')
2728
# set a path for a control socket, allowing us to close this specific ssh connection when desired
2829
tmpcontrolsocket="/tmp/sshsocket${tunnel_db_remote_port}-${RANDOM}"
@@ -33,8 +34,8 @@ function openssh() {
3334
tmpkeyfile=$(mktemp /tmp/xyzfile.XXXXXXXXXXX) || return 1
3435
cat $1 | jq -r '.tunnel_map.ssh_key | gsub("\\\\n"; "\n")' > $tmpkeyfile
3536
# -f=background -N=no remote command -M=master mode StrictHostKeyChecking=no auto-adds host
36-
echo "Running: ssh -f -N -M -o StrictHostKeyChecking=no -S {control socket} -i {key file} -l ${tunnel_username} -L ${tunnel_local_port}:${tunnel_db_host}:${tunnel_db_port} ${tunnel_host}"
37-
ssh -f -N -M -o StrictHostKeyChecking=no -S $tmpcontrolsocket -i $tmpkeyfile -l ${tunnel_username} -L ${tunnel_local_port}:${tunnel_db_host}:${tunnel_db_port} ${tunnel_host} &&
37+
echo "Running: ssh -f -N -M -o StrictHostKeyChecking=no -S {control socket} -i {key file} -l ${tunnel_username} -L ${tunnel_local_port}:${tunnel_db_host}:${tunnel_db_port} -p ${tunnel_port} ${tunnel_host}"
38+
ssh -f -N -M -o StrictHostKeyChecking=no -S $tmpcontrolsocket -i $tmpkeyfile -l ${tunnel_username} -L ${tunnel_local_port}:${tunnel_db_host}:${tunnel_db_port} -p ${tunnel_port} ${tunnel_host} &&
3839
sshopen="yes" &&
3940
echo "ssh tunnel opened"
4041
rm -f $tmpkeyfile
@@ -49,8 +50,8 @@ function openssh() {
4950
fi
5051
# put ssh password in env var for use in sshpass. Better than directly passing with -p
5152
export SSHPASS=$(cat $1 | jq -r '.tunnel_map.tunnel_user_password')
52-
echo "Running: sshpass -e ssh -f -N -M -o StrictHostKeyChecking=no -S {control socket} -l ${tunnel_username} -L ${tunnel_local_port}:${tunnel_db_host}:${tunnel_db_port} ${tunnel_host}"
53-
sshpass -e ssh -f -N -M -o StrictHostKeyChecking=no -S $tmpcontrolsocket -l ${tunnel_username} -L ${tunnel_local_port}:${tunnel_db_host}:${tunnel_db_port} ${tunnel_host} &&
53+
echo "Running: sshpass -e ssh -f -N -M -o StrictHostKeyChecking=no -S {control socket} -l ${tunnel_username} -L ${tunnel_local_port}:${tunnel_db_host}:${tunnel_db_port} -p ${tunnel_port} ${tunnel_host}"
54+
sshpass -e ssh -f -N -M -o StrictHostKeyChecking=no -S $tmpcontrolsocket -l ${tunnel_username} -L ${tunnel_local_port}:${tunnel_db_host}:${tunnel_db_port} -p ${tunnel_port} ${tunnel_host} &&
5455
sshopen="yes" &&
5556
echo "ssh tunnel opened"
5657
fi
@@ -61,7 +62,7 @@ function openssh() {
6162
function closessh() {
6263
# $sshopen $tmpcontrolsocket comes from openssh() function
6364
if [ ! -z "$sshopen" ] ; then
64-
ssh -S $tmpcontrolsocket -O exit ${tunnel_host} &&
65+
ssh -S $tmpcontrolsocket -O exit -p ${tunnel_port} ${tunnel_host} &&
6566
echo "closed ssh tunnel"
6667
trap 'rm -f "$tmpcontrolsocket"' EXIT
6768
fi

docs/understanding-airbyte/basic-normalization.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ Therefore, in order to "upgrade" to the desired normalization version, you need
353353

354354
| Airbyte Version | Normalization Version | Date | Pull Request | Subject |
355355
|:----------------|:----------------------|:-----------| :--- |:---------------------------------------------------------------------------|
356+
| | 0.2.16 | 2022-08-04 | [\#14295](https://github.com/airbytehq/airbyte/pull/14295) | Fixed SSH tunnel port usage |
356357
| | 0.2.14 | 2022-08-01 | [\#14790](https://github.com/airbytehq/airbyte/pull/14790) | Add and persist job failures for Normalization |
357358
| | 0.2.13 | 2022-07-27 | [\#14683](https://github.com/airbytehq/airbyte/pull/14683) | Quote schema name to allow reserved keywords |
358359
| | 0.2.12 | 2022-07-26 | [\#14362](https://github.com/airbytehq/airbyte/pull/14362) | Handle timezone in date-time format. Parse date correct in clickhouse. |

0 commit comments

Comments
 (0)