Skip to content

Fix Hexagon build using ci.py - #11304

Merged
mehrdadh merged 3 commits into
apache:mainfrom
mehrdadh:fix_ci_python
Jun 3, 2022
Merged

Fix Hexagon build using ci.py#11304
mehrdadh merged 3 commits into
apache:mainfrom
mehrdadh:fix_ci_python

Conversation

@mehrdadh

@mehrdadhmehrdadh commented May 12, 2022

Copy link
Copy Markdown
Member

add post build for hexagon
fix -net=host for docker
@mehrdadh
mehrdadh requested a review from driazatiMay 12, 2022 23:38
@github-actions
github-actionsBot requested a review from areuschMay 12, 2022 23:39
@mehrdadhmehrdadh mentioned this pull request May 13, 2022
Comment threadtests/scripts/ci.py Outdated
command.append("-t")
scripts = ["interact() {", " bash", "}", "trap interact 0", ""] + scripts

command.append("--net=host")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we make this one an option rather than on by default? it has security implications when enabled (e.g. it grants the container processes access to all the host's network interfaces)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's on by default in bash.sh when used from a tty, and this doesn't run any random code just the CI scripts so I don't think exposing the host net will cause problems

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding to @driazati's comment, this is what actually runs when we call it:

./docker/bash.sh ci_hexagon --->
docker run --workdir /home/mhessar/tvm --rm --pid=host --net=host --interactive --tty --env CI_BUILD_HOME=/home/mhessar/tvm --env CI_BUILD_USER=mhessar --env CI_BUILD_UID=1007 --env CI_BUILD_GROUP=mhessar --env CI_BUILD_GID=1007 --env CI_PYTEST_ADD_OPTIONS= --env CI_IMAGE_NAME=tlcpack/ci-hexagon:20220505-060045-500703308 --env PYTHONPATH=/home/mhessar/tvm/python --volume /home/mhessar/tvm:/home/mhessar/tvm --volume /home/mhessar/tvm/docker:/docker --volume /home/mhessar/.tvm_test_data:/home/mhessar/tvm/.tvm_test_data tlcpack/ci-hexagon:20220505-060045-500703308 bash --login /docker/with_the_same_user bash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lunderberg this behavior changed to default-on in #8670. did you have rationale behind that you can remember? I feel like maybe we shouldn't do that...but if there is a common use case it breaks then it's probably not worth making folks add that option all the time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. My goal with #8670 was to maintain identical behavior to before the refactor. I kept the --net=host argument disable by default, but conditionally add it back in for interactive sessions whose command is bash with no additional arguments. Let me check to see if that behavior has drifted since then.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifying on main, the USE_NET_HOST variable is defaulted to false, and is only enabled if the --net=host flag is passed to docker/bash.sh, or if the full command being run is bash.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so i think the behavior here should mimic the behavior you're describing.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we merge it then after I resolve the conflict?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so based on @Lunderberg 's comment i think we should only add --net=host when:

  • the command line being run is only bash
  • the user explicitly supplied --net=host to docker/bash.sh

i think we should adopt that in this PR, then we can merge. thoughts?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed --net for now. PTAL!

@areuschareusch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @mehrdadh !

@mehrdadh
mehrdadh merged commit 6dbdf2e into apache:mainJun 3, 2022
@mehrdadh
mehrdadh deleted the fix_ci_python branch June 3, 2022 21:22
Sign up for freeto 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.

4 participants

@mehrdadh@areusch@Lunderberg@driazati