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

Anything written to ~/ does not persist. ~/.gitconfig, ~/.rake, etc.. #30

Closed
apolopena opened this issue Feb 7, 2021 · 1 comment
Closed
Assignees
Labels
bug Something isn't working gitpod-config Related to gitpod configuration (bash scripts etc...) passed-dev-qa Optional state. Use this when QAing other peoples fixes in another branch.ready to be merged to main

Comments

@apolopena
Copy link
Owner

apolopena commented Feb 7, 2021

Describe the bug

When a workspace is stopped and restarted. ~/.rake is blasted away and so is anything written to ~/.gitconfig. In fact any files that are written in the init phase that are not in /workspace (or deeper) will not be there on subsequent startups of the workspace.
A seperate but related issue is that also the initialization log /var/log/workspace-init.log turns into a zero byte file on subsequent starts of a workspace because the docker image writes that file empty and expects the init task to populate it, which it does.... once..... /var/log/workspace-image.log is fine because the docker image writes to it. /var/log/xdebug.log is fine to be reset on every startup aswell unless we wanted to log to persist between startups of the workspace.

UPDATE: this bug has been addressed in Feature #31

td;LR Anything that is written to ~/ from anywhere will not persist.

Screenshots

Steps to reproduce

  1. Create a new workspace
  2. Stop the workspace
  3. Start the workspace
  4. run: git a and the output is:
git: 'a' is not a git command. See 'git --help'.

The most similar commands are
        add
        am
  1. run ls ~/.rake and the output is:
ls: cannot access '/home/gitpod/.rake': No such file or directory

Expected behavior for running git a

Output for (at a minimum) should be:

alias.aliases config --get-regexp '^alias\.'
alias.a config --get-regexp '^alias\.'
alias.cap !f() { git add .; git commit -m "$@"; git push; }; f
alias.new !f() { git cap "📦 NEW: $@"; }; f
alias.imp !f() { git cap "👌 IMPROVE: $@"; }; f
alias.fix !f() { git cap "🐛 FIX: $@"; }; f
alias.rlz !f() { git cap "🚀 RELEASE: $@"; }; f
alias.doc !f() { git cap "📖 DOC: $@"; }; f
alias.tst !f() { git cap "🤖 TEST: $@"; }; f
alias.brk !f() { git cap "‼️ BREAKING: $@"; }; f
alias.lg log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

Expected behavior for running ls ~/.rake

Output (at a minimum) should be:
changelog.rake

Additional information

Currently and unfortunately Gitpod does not persist anything in ~/ (/home/gitpod).

The hack here could be to take out anything that parses, copies or write new files to ~/ and move that into a before task in .gitpod.yml (UPDATE: this worked for the git aliases and the rake tasks).

before tasks run before the init command but unlike the init command before tasks run everytime the workspace is started so take that into consideration.

A system for persisting files needs to be devised.

@apolopena apolopena added the bug Something isn't working label Feb 7, 2021
@apolopena apolopena self-assigned this Feb 7, 2021
@apolopena apolopena added the gitpod-config Related to gitpod configuration (bash scripts etc...) label Feb 7, 2021
apolopena added a commit that referenced this issue Feb 7, 2021
apolopena added a commit that referenced this issue Feb 7, 2021
apolopena added a commit that referenced this issue Feb 7, 2021
@apolopena
Copy link
Owner Author

apolopena commented Feb 7, 2021

Hack required
This bug applies to anything not written to /workspace. Currently Gitpod only persists /workspace
This means that if we want to preserve the init logs in /var/log, they will need to be copied to /workspace
furthermore there will file collisions wunless those files copied to /workspace are put in a folder specifc to that project but not the same name as that project. for example log files for the project test would need to go into /workspace/test-files

@apolopena apolopena added the passed-dev-qa Optional state. Use this when QAing other peoples fixes in another branch.ready to be merged to main label Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gitpod-config Related to gitpod configuration (bash scripts etc...) passed-dev-qa Optional state. Use this when QAing other peoples fixes in another branch.ready to be merged to main
Projects
None yet
Development

No branches or pull requests

1 participant