Skip to content

Commit

Permalink
v1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rimusz committed Jul 6, 2016
1 parent 71ab20f commit 578880b
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 58 deletions.
27 changes: 7 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
*.xccheckout

#CocoaPods
Pods
.imdone
.imdoneignore
.vscode
imgs
*.img
tmp.*
*.tar.gz
62 changes: 62 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# How to Contribute

This project is [Apache 2.0 licensed](LICENSE) and accept contributions via
GitHub pull requests. This document outlines some of the conventions on
development workflow, commit message formatting, contact points and other
resources to make it easier to get your contribution accepted.

# Certificate of Origin

By contributing to this project you agree to the Developer Certificate of
Origin (DCO). This document was created by the Linux Kernel community and is a
simple statement that you, as a contributor, have the legal right to make the
contribution. See the [DCO](DCO) file for details.

## Getting Started

- Fork the repository on GitHub
- Read the [README](README.md) for build and test instructions
- Play with the project, submit bugs, submit patches!

## Contribution Flow

This is a rough outline of what a contributor's workflow looks like:

- Create a topic branch from where you want to base your work (usually master).
- Make commits of logical units.
- Make sure your commit messages are in the proper format (see below).
- Push your changes to a topic branch in your fork of the repository.
- Make sure the tests pass, and add any new tests as appropriate.
- Submit a pull request to the original repository.

Thanks for your contributions!

### Format of the Commit Message

We follow a rough convention for commit messages that is designed to answer two
questions: what changed and why. The subject line should feature the what and
the body of the commit should describe the why.

```
scripts: add the test-cluster command
this uses tmux to setup a test cluster that you can easily kill and
start for debugging.
Fixes #38
```

The format can be described more formally as follows:

```
<subsystem>: <what changed>
<BLANK LINE>
<why this change was made>
<BLANK LINE>
<footer>
```

The first line is the subject and should be no longer than 70 characters, the
second line is always blank, and other lines should be wrapped at 80 characters.
This allows the message to be easier to read on GitHub as well as in various
git tools.
36 changes: 36 additions & 0 deletions DCO
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rimas Mocevicius <[email protected]>
59 changes: 33 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
CoreOS VM for OS X
CoreOS VM for macOS
========================

**CoreOS VM for OS X** (coreos-machine) is a Mac Status bar App which works like a wrapper around the [corectl](https://github.com/TheNewNormal/corectl) command line tool (it makes easier to control [xhyve](https://github.com/xhyve-xyz/xhyve) based VMs).
**CoreOS VM** is masOS `status bar app` which allows in an easy way to control CoreOS VM on your Mac.

It leverages macOS native Hypervisor framework of using [xhyve](https://github.com/xhyve-xyz/xhyve) based [corectl](https://github.com/TheNewNormal/corectl) command line tool without any needs to use VirtualBox or similar virtualisation software.

The best use case of this App is to allow to build/test [Docker](https://www.docker.com) and [rkt](https://coreos.com/rkt/) images localy.
You can use included [Docker Registry v2](https://github.com/docker/distribution) (Go based and compiled for OS X) to store
your Docker images and share with Kubernetes Apps for OS X: [Kube-solo](https://github.com/TheNewNormal/kube-solo-osx) and [Kube-Cluster](https://github.com/TheNewNormal/kube-cluster-osx)
You can use included [Docker Registry v2](https://github.com/docker/distribution) (Go based and compiled for macOS) to store
your Docker images and share with Kubernetes Apps for macOS: [Kube-solo](https://github.com/TheNewNormal/kube-solo-osx) and [Kube-Cluster](https://github.com/TheNewNormal/kube-cluster-osx)

![CoreOS-OSX](coreos-osx.png "CoreOS-OSX")


How to install CoreOS VM for OS X
How to install CoreOS VM for macOS
----------

**Requirements**
-----------
- **OS X 10.10.3** Yosemite or later
- Mac 2010 or later for this to work.


####Download:
* Download `CoreOS OSX latest.dmg` from the [Releases Page](https://github.com/TheNewNormal/coreos-osx/releases)
- **macOS 10.10.3** Yosemite or later
- Mac 2010 or later for this to work
- [Corectl App](https://github.com/TheNewNormal/corectl.app) is installed

###Install:

Open downloaded `dmg` file and drag the App e.g. to your Desktop. Start the `CoreOS OSX` and `Initial setup of CoreOS OSX` will run.
####Install:
- Download [corectl](https://github.com/TheNewNormal/corectl) server control [Corectl App](https://github.com/TheNewNormal/corectl.app) `latest dmg` from the [Releases Page](https://github.com/TheNewNormal/corectl.app/releases) and install it to `/Applications` folder
- Download `CoreOS latest.dmg` from the [Releases Page](https://github.com/TheNewNormal/coreos-osx/releases). Open downloaded `dmg` file and drag the App e.g. to your Desktop. Start the `CoreOS` app and `Initial setup` will beggin.

**TL;DR**

- App's files are installed to `~/coreos-osx` folder
- CoreOS ISO files are stored under `~/.coreos` folder
- Docker registry runs on `192.168.64.1:5000` and images are stored under `~/coreos-osx/registry`
- Mac user home folder is automaticly mounted to VM: `/Users/my_user`:`/Users/my_user`
- OS X `docker` client is installed to `~/coreos-osx/bin` and preset in `OS shell` to be used from there
- macOS `docker` client is installed to `~/coreos-osx/bin` and preset in `OS shell` to be used from there


**The install will do the following:**

- All dependent files/folders will be put under `coreos-osx` folder in the user's home folder e.g /Users/someuser/coreos-osx
- Mac user home folder is automaticly mounted to VM: `/Users/my_user` can be accessed on VM via the same `/Users/my_user`, it is very handy for using docker mounted volumes
- User's Mac password will be stored in `OS X Keychain`, it will be used to pass to `sudo` command which needs to be used starting the VM, this allows to avoid using `sudo` for `corectl` to start a VM.
- User's Mac password will be stored in `macOS Keychain`, it will be used to pass to `sudo` command which needs to be used starting the VM, this allows to avoid using `sudo` for `corectl` to start a VM.
- ISO images are stored under `~/.coreos/images`
That allows to share the same images between different `corectl` based Apps and also speeds up this App VMs reinstall
- user-data file will have Docker Socket for the API enabled
- Will download latest CoreOS ISO image and run `corectl` to initialise VM with docker 2375 port pre-set for docker OS X client
- Will download and install `docker` OS X client to ~/coreos-osx/bin/
- Will download latest CoreOS ISO image and run `corectl` to initialise VM with docker 2375 port pre-set for docker macOS client
- Will download and install `docker` macOS client to ~/coreos-osx/bin/
- A small shell script `rkt` will be installed to ~/coreos-osx/bin/ which allows to call via ssh remote `rkt` binary on CoreOS VM
- A small shell script `etcdctl` will be installed to ~/coreos-osx/bin/ which allows to call via ssh remote `etcdctl` binary on CoreOS VM
- `docker-exec` script (docker exec -it $1 bash -c 'export TERM=xterm && bash') will be installed
Expand Down Expand Up @@ -82,24 +83,30 @@ and docker-exec shell scripts are stored
```

* `OS Shell` opens OS Shell with the same enviroment preset as `Up`
* `Updates/Check for update of docker OS X client` will update fleet and docker OS X clients to the same versions as CoreOS VM runs.
* `Updates/Check for update of docker macOS client` will update fleet and docker macOS clients to the same versions as CoreOS VM runs.
* `Updates/Fetch latest CoreOS ISO` will download the lasted CoreOS ISO file for the currently set release channel.
* [UI for Docker](https://github.com/kevana/ui-for-docker) will show up all running containers and etc
* You can upload your saved/exported docker images place in `~/coreos-osx/docker_images` folder via `Upload docker images`
* Local Docker Registry v2 (Go based and compiled for OS X) is running on `192.168.64.1:5000`, which gets started/stopped on each VM Up/Halt.
* This App has as much automation as possible to make easier to use CoreOS on OS X, e.g. you can change CoreOS release channel and reload VM as `root` persistant disk for VM will be created and mounted to `/` so data will survive VM reboots.
* Local Docker Registry v2 (Go based and compiled for macOS) is running on `192.168.64.1:5000`, which gets started/stopped on each VM Up/Halt.
* This App has as much automation as possible to make easier to use CoreOS on macOS, e.g. you can change CoreOS release channel and reload VM as `root` persistant disk for VM will be created and mounted to `/` so data will survive VM reboots.

### have fun!

Credits
-----------
* To [António Meireles](https://github.com/AntonioMeireles) for his awesome [corectl](https://github.com/TheNewNormal/corectl) tool to easily control [xhyve](https://github.com/xhyve-xyz/xhyve)
* To [Michael Steil](https://github.com/mist64) for the awesome [xhyve](https://github.com/mist64/xhyve) lightweight OS X virtualization solution
* To Kelsey Hightower for [Docker Registry OS X Setup Guide](https://github.com/kelseyhightower/docker-registry-osx-setup-guide).
* To [Michael Steil](https://github.com/mist64) for the awesome [xhyve](https://github.com/mist64/xhyve) lightweight macOS virtualization solution
* To Kelsey Hightower for [Docker Registry macOS Setup Guide](https://github.com/kelseyhightower/docker-registry-osx-setup-guide).


Other CoreOS VM based Apps
Other CoreOS VM based Apps for macOS
-----------
* Cluster one CoreOS VM App can be found here [CoreOS Cluster for OS X](https://github.com/rimusz/coreos-osx-cluster).
* Kubernetes Solo Cluster VM App (corectl based) can be found here [Kube Solo for OS X](https://github.com/TheNewNormal/kube-solo-osx).
* Kubernetes Cluster one CoreOS VM App can be found here [CoreOS Kubernetes Cluster for OS X ](https://github.com/rimusz/coreos-osx-kubernetes-cluster).
* Cluster one CoreOS VM App can be found here [CoreOS Cluster for macOS](https://github.com/rimusz/coreos-osx-cluster).
* Kubernetes Solo Cluster VM App (corectl based) can be found here [Kube Solo for macOS](https://github.com/TheNewNormal/kube-solo-osx).
* Kubernetes Cluster one CoreOS VM App can be found here [CoreOS Kubernetes Cluster for macOS ](https://github.com/rimusz/coreos-osx-kubernetes-cluster).

## Contributing

**Corectl App** is an [open source](http://opensource.org/osd) project release under
the [Apache License, Version 2.0](http://opensource.org/licenses/Apache-2.0),
hence contributions and suggestions are gladly welcomed!
8 changes: 6 additions & 2 deletions src/CoreOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
01D3685918E5C184006510B5 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 01D3685818E5C184006510B5 /* icon.icns */; };
01E2853E18A6C4E300BC630D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 01E2853D18A6C4E300BC630D /* Cocoa.framework */; };
01E285B818A6D7F400BC630D /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 01E285B718A6D7F400BC630D /* icon.png */; };
13164EBA1D2D2E8400642B0A /* run_corectl_app.command in Resources */ = {isa = PBXBuildFile; fileRef = 13164EB91D2D2E8400642B0A /* run_corectl_app.command */; };
133DD11C1CE49AB900059FCC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 133DD10E1CE49AB900059FCC /* AppDelegate.m */; };
133DD11D1CE49AB900059FCC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 133DD10F1CE49AB900059FCC /* MainMenu.xib */; };
133DD11F1CE49AB900059FCC /* CoreOS.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = 133DD1131CE49AB900059FCC /* CoreOS.entitlements */; };
Expand Down Expand Up @@ -66,6 +67,7 @@
01E2854218A6C4E300BC630D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
01E2855C18A6C4E300BC630D /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
01E285B718A6D7F400BC630D /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
13164EB91D2D2E8400642B0A /* run_corectl_app.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = run_corectl_app.command; sourceTree = "<group>"; };
133DD10D1CE49AB900059FCC /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
133DD10E1CE49AB900059FCC /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
133DD1101CE49AB900059FCC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -153,6 +155,7 @@
01E285B918A6E23C00BC630D /* Scripts */ = {
isa = PBXGroup;
children = (
13164EB91D2D2E8400642B0A /* run_corectl_app.command */,
137018B31C11F1FD0002B2B9 /* docker_registry.sh */,
01741B64190DB81400BB1F91 /* up.command */,
0106B3491B65277F001709E0 /* functions.sh */,
Expand Down Expand Up @@ -283,6 +286,7 @@
134AB3371BD7ECAB00D55BC4 /* upload_docker_images.command in Resources */,
019662181B04C6EA005FA955 /* files in Resources */,
01741B63190DB80500BB1F91 /* first-init.command in Resources */,
13164EBA1D2D2E8400642B0A /* run_corectl_app.command in Resources */,
01B675D61B602FC2004349CC /* check_vm_status.command in Resources */,
0106B34A1B65277F001709E0 /* functions.sh in Resources */,
01741B57190DB7B800BB1F91 /* coreos-osx-install.command in Resources */,
Expand Down Expand Up @@ -423,7 +427,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "CoreOS/CoreOS-Prefix.pch";
INFOPLIST_FILE = "CoreOS/CoreOS-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "net.linxos.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = CoreOS;
PROVISIONING_PROFILE = "";
Expand All @@ -443,7 +447,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "CoreOS/CoreOS-Prefix.pch";
INFOPLIST_FILE = "CoreOS/CoreOS-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "net.linxos.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = CoreOS;
PROVISIONING_PROFILE = "";
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>CoreOS GUI.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>CoreOS GUI.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>01E2853918A6C4E300BC630D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
35 changes: 34 additions & 1 deletion src/CoreOS/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
[[NSApplication sharedApplication] terminate:self];
}

// check that corectl.app is installed at /Applications folder
if(![[NSWorkspace sharedWorkspace] launchApplication:@"/Applications/corectl.app"]) {
NSLog(@"corectl failed to launch");

// show alert message
NSString *mText = [NSString stringWithFormat:@"%@", @"CoreOS App cannot start !!!"];
NSString *infoText = @"corectl.app cannot be found in /Applications folder, the download link will be opened in your browser ...";
[self displayWithMessage:mText infoText:infoText];

// open corectl.app releases URL
NSString *url = [@[@"https://github.com/TheNewNormal/corectl.app/releases"] componentsJoinedByString:@""];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];

// exiting App
[[NSApplication sharedApplication] terminate:self];
}


NSString *home_folder = [NSHomeDirectory() stringByAppendingPathComponent:@"coreos-osx"];

Expand Down Expand Up @@ -90,6 +107,23 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification


- (IBAction)Start:(id)sender {
// check that corectl.app is installed in /Applications folder
if(![[NSWorkspace sharedWorkspace] launchApplication:@"/Applications/corectl.app"]) {
NSLog(@"corectl failed to launch");

// show alert message
NSString *mText = [NSString stringWithFormat:@"%@", @"Cannot start VM !!!"];
NSString *infoText = @"corectl.app cannot be found in /Applications folder, the download link will be opened in your browser ...";
[self displayWithMessage:mText infoText:infoText];

// open corectl.app releases URL
NSString *url = [@[@"https://github.com/TheNewNormal/corectl.app/releases"] componentsJoinedByString:@""];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];

//
return;
}

int vm_status=[self checkVMStatus];
NSLog (@"VM status:\n%d", vm_status);

Expand Down Expand Up @@ -142,7 +176,6 @@ - (IBAction)Start:(id)sender {
notification.informativeText = @"VM is already running !!!";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
}

}


Expand Down
4 changes: 2 additions & 2 deletions src/CoreOS/CoreOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.0</string>
<string>1.4.1</string>
<key>CFBundleVersion</key>
<string>511</string>
<string>515</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Loading

0 comments on commit 578880b

Please sign in to comment.