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

Point $HOME to /tekton/home #1628

Merged
merged 1 commit into from
Nov 27, 2019
Merged

Conversation

imjasonh
Copy link
Member

/builder/home is still mounted, backed by the same volume, to allow
users some time to move over before we move /builder/home in v0.10 and
beta.

More progress toward #1030

This is step 1 of a breaking change, since some users might unfortunately rely on the specific path that we document. We'll warn people in v0.9 release notes that the path is changing, and remove the old path in v0.10.

Users who rely on $HOME will not be affected (that points to /tekton/home after this change)

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

:rotating_light: Change $HOME to /tekton/home

/builder/home is still provided, backed by the same volume, but will be removed in a future release

@imjasonh imjasonh added this to the Pipelines 0.9 🐱 milestone Nov 26, 2019
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Nov 26, 2019
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 26, 2019
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

/cc @bobcatfish @dibyom @afrittoli

@tekton-robot tekton-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 27, 2019
Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

yesssss thanks for all the doc updates 🎉

This seems reasonable to me! I could see someone relying on $HOME but also hardcoding /builder/home in the same Task but regardless this seems like a reasonable path forward to me.

Just a couple quick questions about things I'm a bit confused by.

/approve

examples/taskruns/old-home-volume.yaml Outdated Show resolved Hide resolved
args: ['-c', '[[ ! -f /builder/home/stuff ]]']
volumeMounts:
- name: empty
mountPath: /builder/home
Copy link
Collaborator

Choose a reason for hiding this comment

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

question for my own self reasons (aka #1438 ) : how useful do you find it to be able to declare volumeMounts for every step and is this something you'd want if you could define a volumeMount for the entire Task instead?

Copy link
Member

Choose a reason for hiding this comment

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

I think that's possible today with the step template

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I think that's what stepTemplate and task.spec.volumes is for.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean it's possible but do you feel like you want to do it - i.e. would you be happy with just having a volume that is mounted for the entire Task and volumeMounts on a step didnt work?

if im not making any sense then just ignore me and ill ask you both again once I have an example :D

pkg/pod/pod.go Outdated Show resolved Hide resolved
pkg/pod/workingdir_init_test.go Show resolved Hide resolved
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bobcatfish, vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [bobcatfish,vdemeester]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2019
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thanks for this!
It would be nice to start using $HOME in the examples - that can be a follow-up though.

/lgtm

@@ -90,7 +90,7 @@ spec:
# specifying DOCKER_CONFIG is required to allow kaniko to detect docker credential
env:
- name: "DOCKER_CONFIG"
value: "/builder/home/.docker/"
value: "/tekton/home/.docker/"
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be nicer to use $HOME/.docker here - so we don't promote relying on a specific path

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, env var values can't be based on other existing env var values. :(

You need a shell involved to actually resolve env vars.

We could do some silly nonsense like replacing the string $HOME in env var values before we send it to the Pod, but that feels like a confusing change from K8s behavior that I'd like to avoid.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, good point, I see. This is really a pity though.
It might be worth having a built-in variable for that, but I would use Tekton syntax to avoid confusion:

       env:
          - name: "DOCKER_CONFIG"
            value: "$(home)/.docker/"

docs/taskruns.md Show resolved Hide resolved
examples/taskruns/old-home-volume.yaml Outdated Show resolved Hide resolved
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2019
/builder/home is still mounted, backed by the same volume, to allow
users some time to move over before we move /builder/home in v0.10 and
beta.
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2019
@vdemeester
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2019
@imjasonh
Copy link
Member Author

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 27, 2019
@tekton-robot tekton-robot merged commit 6ea8888 into tektoncd:master Nov 27, 2019
@@ -105,7 +105,7 @@ spec:
DATE=$(date +"%Y%m%d")
VERSION_TAG="$DATE-$COMMIT"

echo $VERSION_TAG > "/builder/home/version"
echo $VERSION_TAG > "/tekton/home/version"
Copy link
Member

Choose a reason for hiding this comment

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

I just realized that since this runs on Tekton 0.3.1, there will be no /tekton/home there :(

afrittoli added a commit to afrittoli/pipeline that referenced this pull request Dec 3, 2019
This was changes in tektoncd#1628,
however since this task runs on Tekton 0.3.1, we need to stick
with /builder/home there, at least until we get rid of Tekton 0.3.1
in the Prow cluster.
tekton-robot pushed a commit that referenced this pull request Dec 3, 2019
This was changes in #1628,
however since this task runs on Tekton 0.3.1, we need to stick
with /builder/home there, at least until we get rid of Tekton 0.3.1
in the Prow cluster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants