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

Set http_proxy and related env vars for containers #304

Merged
merged 2 commits into from
Jan 27, 2020

Conversation

dakale
Copy link
Contributor

@dakale dakale commented Jan 24, 2020

We dont pass the Runner's environment through to containers so http_proxy is not necessarily picked up

Work for the actionable parts of https://github.com/github/c2c-actions-runtime/issues/339

Added a variable to track the actual value of no_proxy to avoid having to rebuild it from the parts we split it into

Simple canary workflow:

jobs:
  proxy-host:
    runs-on: [ self-hosted, linux ]
    steps:
    - run: |
        printenv
        curl -v httpbin.org/uuid
  proxy-container:
    runs-on: [ self-hosted, linux ]
    container:
      image: ubuntu
    services:
      squid:
        image: dakale/squid
    steps:
    - run: |
        apt-get -o Acquire::http::proxy=false update > /dev/null && apt-get -o Acquire::http::proxy=false install -y curl > /dev/null
        printenv
        curl -v httpbin.org/uuid

Traffic through squid is shown by cache headers added by the proxy

@dakale dakale merged commit 17970ad into master Jan 27, 2020
@dakale dakale deleted the runtime-339-docker-http-proxy branch January 27, 2020 15:56
AdamOlech pushed a commit to antmicro/runner that referenced this pull request Jan 28, 2021
* WIP add in basic passthrough for proxy env vars

* Add http_proxy vars after container env is created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants