Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using CML behind a proxy #336

Closed
rene-rex opened this issue Nov 6, 2020 · 8 comments · Fixed by #674
Closed

Using CML behind a proxy #336

rene-rex opened this issue Nov 6, 2020 · 8 comments · Fixed by #674
Assignees
Labels
cml-publish Subcommand p0-critical Max priority (ASAP)

Comments

@rene-rex
Copy link

rene-rex commented Nov 6, 2020

Hi

Everything running on my GitLab runner must go through a proxy to get anything from the outside world. So, I set the corresponding variables as usual:

stages: 
    - cml_run
    
cml:
    stage: cml_run
    image: dvcorg/cml-py3:latest
    
    script:
        - export http_proxy=proxy:8080
        - export https_proxy=proxy:8080
        - export no_proxy=localhost,127.0.0.1

        - pip3 install -r requirements.txt
        - python train.py > report.md
        
        - cml-publish roc_curve.png --md >> report.md
        - cml-send-comment report.md

However, this results in an error at cml-publish:

$ cml-publish roc_curve.png --md >> report.md
internal/url.js:257
  throw new ERR_INVALID_URL(input);
  ^
TypeError [ERR_INVALID_URL]: Invalid URL: proxy:8080
    at onParseError (internal/url.js:257:9)
    at new URL (internal/url.js:333:5)
    at Object.getProxyUrl (/cml/node_modules/@actions/http-client/proxy.js:17:20)
    at HttpClient._getAgent (/cml/node_modules/@actions/http-client/index.js:404:27)
    at HttpClient.getAgent (/cml/node_modules/@actions/http-client/index.js:358:21)
    at Object.getProxyAgent (/cml/node_modules/@actions/github/lib/internal/utils.js:36:15)
    at Object.<anonymous> (/cml/node_modules/@actions/github/lib/utils.js:34:22)
    at Module._compile (internal/modules/cjs/loader.js:1015:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
    at Module.load (internal/modules/cjs/loader.js:879:32) {
  input: 'proxy:8080',
  code: 'ERR_INVALID_URL'

I tried to prefix the variables with http/https since it is complaining about an invalid URL but this just gave me another error:

$ cml-publish roc_curve.png --md >> report.md
FetchError: request to https://asset.cml.dev/ failed, reason: connect ECONNREFUSED 123.45.67.890:443
    at ClientRequest.<anonymous> (/cml/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (events.js:326:22)
    at TLSSocket.socketErrorListener (_http_client.js:428:9)
    at TLSSocket.emit (events.js:314:20)
    at emitErrorNT (internal/streams/destroy.js:92:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'

The IP is anonymized above. Any idea how to make CML play nicely with the proxy?

@rene-rex rene-rex changed the title Using CML behing a proxy Using CML behind a proxy Nov 9, 2020
@DavidGOrtega
Copy link
Contributor

DavidGOrtega commented Nov 9, 2020

Hi @rene-rex, thanks for the feedback!
Calls to GL are done via node fetch. And it's not supported.
Im willing to extend it to support http_proxy.

@rene-rex
Copy link
Author

That would be great, thanks! I happy to test a fix whenever you have one.

@DavidGOrtega
Copy link
Contributor

I think that tomorrow we will have the PR 🚀

@pirnerjonas
Copy link

Are there any updates on this? I am currently also facing this problem with cml-runner I think..

@rene-rex
Copy link
Author

Since I am unable to use CML due to this bug, I moved on. So I can't help you here @pirnerjonas

@pirnerjonas
Copy link

Thanks for writing @rene-rex. Yeah, I think I will also be unable to use CML then..

@DavidGOrtega DavidGOrtega added the p0-critical Max priority (ASAP) label Apr 21, 2021
@DavidGOrtega
Copy link
Contributor

@pirnerjonas @rene-rex priority 0 now ;)

@DavidGOrtega
Copy link
Contributor

@pirnerjonas @rene-rex @0x2b3bfa0

while we had a solution for GL the problem is fundamentally GH. Basically they have the same blocker:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cml-publish Subcommand p0-critical Max priority (ASAP)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants