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

core: rename data dir environment var #1014

Merged
merged 6 commits into from Apr 22, 2017
Merged

core: rename data dir environment var #1014

merged 6 commits into from Apr 22, 2017

Conversation

kr
Copy link
Contributor

@kr kr commented Apr 21, 2017

This change serves two goals:

  • Rename the env var to CHAIN_CORE_DATA.
  • Leave overriding the location to platform-specific
    tooling.

For the second item, the Mac OS X app explicitly sets
CHAIN_CORE_DATA to the appropriate location for
Mac OS X (as opposed to plain Darwin).

Future work: also update the Windows installer.

@kr kr requested review from dominic and tessr April 21, 2017 23:07
@kr
Copy link
Contributor Author

kr commented Apr 21, 2017

Note: we can't safely land this until the mac app and windows installer are updated. Maybe that should happen in this same PR.

@kr
Copy link
Contributor Author

kr commented Apr 21, 2017

This is based on a conversation @dominic and I had earlier today.

@tessr
Copy link
Contributor

tessr commented Apr 21, 2017

I think that the installers should set that environment variable in this PR, too. (I also want to change the Postgres data directory for the windows installer, but I haven't gotten around to it yet.)

@dominic
Copy link
Contributor

dominic commented Apr 21, 2017

Existing change LGTM, but it would be nice to get the Mac app change in here as well.

[edit] I'll aim to push that in here today.

@kr
Copy link
Contributor Author

kr commented Apr 21, 2017

rebased

@@ -15,6 +15,10 @@ class ChainCore: NSObject {
return "postgres://localhost:\(dbPort)/core?sslmode=disable"
}

var homeDir: String {
return NSProcessInfo().environment["HOME"] + "/Library/Application Support/Chain Core"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fa5

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

(We're not sandboxed, but it's probably safest if we ever manage that path.)

@dominic
Copy link
Contributor

dominic commented Apr 21, 2017

Mac LGTM. I had to delete the existing /Application Support folder to get it to run: it wasn't happy with the data there from my other Chain Cores:

at=raft.go:505 t=2017-04-21T23:53:33.516637877Z message="dummy write failed with context deadline exceeded"
raft2017/04/21 16:53:33 INFO: 1 is starting a new election at term 8
raft2017/04/21 16:53:33 INFO: 1 became candidate at term 9
raft2017/04/21 16:53:33 INFO: 1 received MsgVoteResp from 1 at term 9
raft2017/04/21 16:53:33 INFO: 1 became leader at term 9
raft2017/04/21 16:53:33 INFO: raft.node: 1 elected leader 1 at term 9
at=raft.go:683 t=2017-04-21T23:53:33.551906401Z index=73 ent="{9 73 EntryNormal [] []}"
at=raft.go:717 t=2017-04-21T23:53:33.551945752Z EntryNormal="{9 73 EntryNormal [] []}"
at=raft.go:683 t=2017-04-21T23:53:33.570979866Z index=74 ent="{9 74 EntryNormal [123 34 87 99 116 120 34 58 34 105 49 118 72 81 109 53 115 99 43 51 114 55 98 109 79 101 76 76 69 82 65 61 61 34 44 34 73 110 115 116 114 117 99 116 105 111 110 34 58 34 69 103 48 83 67 121 57 107 100 87 49 116 101 86 100 121 97 88 82 108 34 125] []}"
at=raft.go:717 t=2017-04-21T23:53:33.571043271Z EntryNormal="{9 74 EntryNormal [123 34 87 99 116 120 34 58 34 105 49 118 72 81 109 53 115 99 43 51 114 55 98 109 79 101 76 76 69 82 65 61 61 34 44 34 73 110 115 116 114 117 99 116 105 111 110 34 58 34 69 103 48 83 67 121 57 107 100 87 49 116 101 86 100 121 97 88 82 108 34 125] []}"
at=state.go:93 t=2017-04-21T23:53:33.571095800Z message="state instruction: operations:<key:\"/dummyWrite\" > "
2017-04-21 16:53:33.999274-0700 Chain Core[95238:74853139] ServerManager: Chain Core is running.
2017-04-21 16:53:34.573112-0700 Chain Core[95238:74853849] Chain Core stopped unexpectedly. Exiting.

@kr kr changed the title core: rename data dir env & location core: rename data dir environment var Apr 22, 2017
kr and others added 6 commits April 22, 2017 00:13
This change serves three goals:
- Rename the env var to CHAIN_CORE_DATA
- Rename the default location to $HOME/.chaincore
- Leave overriding the location to platform-specific
tooling.

For the last item specifically, the Mac app and the
Windows installer will explicitly set CHAIN_CORE_DATA to
platform-specific values such as '~/Library/Application
Support/Chain Core'.
@iampogo iampogo merged commit 338f54e into main Apr 22, 2017
@iampogo iampogo deleted the platform-dir branch April 22, 2017 00:16
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.

None yet

4 participants