Difference between revisions of "Localyzer Machine Translation through a Proxy Server"

From Lingoport Wiki
Jump to: navigation, search
Line 5: Line 5:
 
This is done by setting the 'https_proxy' environment variable. Another variable, 'http_proxy', is available for http connections, but will not be needed for use with Amazon Translate.
 
This is done by setting the 'https_proxy' environment variable. Another variable, 'http_proxy', is available for http connections, but will not be needed for use with Amazon Translate.
   
= Quick Proxy Validation =
+
= Proxy Validation =
   
 
It is recommended that you validate you have access to your proxy from your system, prior to enabling it.
 
It is recommended that you validate you have access to your proxy from your system, prior to enabling it.
   
Quick test steps (example proxy used is http://masnes.testproxy.internal.lingoport.io:3128) :
+
Test steps (example proxy used is http://masnes.testproxy.internal.lingoport.io:3128):
 
* ssh to your system
 
* ssh to your system
 
* install 'telnet', if it is not already present
 
* install 'telnet', if it is not already present
Line 29: Line 29:
 
: Expected Result
 
: Expected Result
 
:: <your systems ip>, something like '34.195.141.162'
 
:: <your systems ip>, something like '34.195.141.162'
: Alternate Expected Result - You'll see this if you are blocked from external connections by your firewall. This is ok too:
+
: Alternate Expected Result - You'll see this if you are blocked from external connections by your firewall (possibly what you're using the proxy to get avoid):
:: ...Connection timed out after 5 seconds.
+
:: NOTE ...Connection timed out after 5 seconds.
 
* Next, try using the proxy with curl + an external site that will return the found ip address.
 
* Next, try using the proxy with curl + an external site that will return the found ip address.
 
: Command
 
: Command
Line 37: Line 37:
 
:: <code>https_proxy="http://masnes.testproxy.internal.lingoport.io:3128" curl https://canhazip.com --silent --connect-timeout 5 || echo "FAILED: With proxy, connection timed out after 5 seconds."</code>
 
:: <code>https_proxy="http://masnes.testproxy.internal.lingoport.io:3128" curl https://canhazip.com --silent --connect-timeout 5 || echo "FAILED: With proxy, connection timed out after 5 seconds."</code>
 
: Expected Result
 
: Expected Result
:: <proxy ip>, something different from the above. For the above example it was '54.205.127.98'
+
:: <proxy ip>, something different from the above. For the above example it was '54.205.127.98'. The connection should ''not'' fail.
   
  +
If you're able to connect to the proxy via telnet, you're able to use the proxy to get your remote ip from https://canhazip.com, and if the result you get from https://canhazip.com via the proxy is different than without the proxy, then you are ready to proceed.
   
  +
= Defining the Proxy for use with LRM AWS Machine Translate =
2. perform a curl against an ip reporting site with no proxy setting, record the IP returned.
 
: <code>https_proxy="" curl https://canhazip.com<code> https://canhazip.com --silent --connect-timeout 5 || echo "FAILED: With proxy, connection timed out after 5 seconds."</code>
 
::
 
   
  +
To set a proxy server, define the environment variable "https_proxy" prior to running LRM with AWS Machine Translation. Through Jenkins, the easiest way to do so is:
   
  +
: Manage Jenkins -> (Goes to a new page)
# Defining the Proxy for use with LRM AWS Machine Translate
 
  +
: Configure System -> (Goes to a new page)
 
  +
: Global Properties -> Environment Variables -> Add (Button at the bottom of the Environment Variables settings)
To set a proxy server, define the environment variable "https_proxy" prior to running LRM. Through Jenkins, the easiest way to do so is:
 
 
Manage Jenkins -> New Page
 
Configure System -> New Page
 
Global Properties -> Environment Variables -> Add (Button at the bottom of the Environment Variables settings)
 
   
 
Settings should be:
 
Settings should be:
Line 61: Line 57:
 
http://masnes.testproxy.internal.lingoport.io:3128
 
http://masnes.testproxy.internal.lingoport.io:3128
   
# Validating the Proxy
+
= Validating the Proxy through Jenkins =
  +
  +
You can add a step to your Jenkins Automation build(s) to confirm that the proxy is used. To do so:
  +
  +
: Start at the Jenkins HomePage
  +
: Select the build you would like to test with. For example 'MyCompany.MyProject' -> (Goes to a new page)
  +
: Go to Configure on the left -> (Goes to a new page)
  +
:

Revision as of 19:35, 4 November 2020

Rational

A proxy Server may be used for Localyzer AWS Machine Translation if necessary for IT/Network/Security requirements.

This is done by setting the 'https_proxy' environment variable. Another variable, 'http_proxy', is available for http connections, but will not be needed for use with Amazon Translate.

Proxy Validation

It is recommended that you validate you have access to your proxy from your system, prior to enabling it.

Test steps (example proxy used is http://masnes.testproxy.internal.lingoport.io:3128):

  • ssh to your system
  • install 'telnet', if it is not already present
sudo yum install telnet
  • validate that you can connect to your proxy server, while keeping proxy settings clear - for now:
http_proxy="" https_proxy="" telnet <proxyurl-no-http/s> <proxyport>
Example:
http_proxy="" https_proxy="" telnet masnes.testproxy.internal.lingoport.io 3128
Result
Trying 172.31.81.146...
Connected to masnes.testproxy.internal.lingoport.io.
Escape character is '^]'.
Note: Enter will quit and return you to your terminal.
If the connection takes more than 5 seconds, you may not be able to connect to the proxy, please check your networking connection settings before continuing.
  • Next, as a comparison point, try curling + to an external site that will return the found ip address, without using the proxy settings yet.
Here, we use 'https://canhazip.com' as the external site. We set a timeout in case the connection is blocked.
Command
https_proxy="" curl https://canhazip.com --silent --connect-timeout 5 || echo "NOTE: ...Connection timed out after 5 seconds."
Expected Result
<your systems ip>, something like '34.195.141.162'
Alternate Expected Result - You'll see this if you are blocked from external connections by your firewall (possibly what you're using the proxy to get avoid):
NOTE ...Connection timed out after 5 seconds.
  • Next, try using the proxy with curl + an external site that will return the found ip address.
Command
https_proxy="http://<proxyurl>:<proxyport>" curl https://canhazip.com --silent --connect-timeout 5 || echo "FAILED: With proxy, connection timed out after 5 seconds."
Example
https_proxy="http://masnes.testproxy.internal.lingoport.io:3128" curl https://canhazip.com --silent --connect-timeout 5 || echo "FAILED: With proxy, connection timed out after 5 seconds."
Expected Result
<proxy ip>, something different from the above. For the above example it was '54.205.127.98'. The connection should not fail.

If you're able to connect to the proxy via telnet, you're able to use the proxy to get your remote ip from https://canhazip.com, and if the result you get from https://canhazip.com via the proxy is different than without the proxy, then you are ready to proceed.

Defining the Proxy for use with LRM AWS Machine Translate

To set a proxy server, define the environment variable "https_proxy" prior to running LRM with AWS Machine Translation. Through Jenkins, the easiest way to do so is:

Manage Jenkins -> (Goes to a new page)
Configure System -> (Goes to a new page)
Global Properties -> Environment Variables -> Add (Button at the bottom of the Environment Variables settings)

Settings should be: Name: https_proxy Value: http://<yourproxy>:<yourproxyport>

Example https_proxy http://masnes.testproxy.internal.lingoport.io:3128

Validating the Proxy through Jenkins

You can add a step to your Jenkins Automation build(s) to confirm that the proxy is used. To do so:

Start at the Jenkins HomePage
Select the build you would like to test with. For example 'MyCompany.MyProject' -> (Goes to a new page)
Go to Configure on the left -> (Goes to a new page)