Skip to content

Commit

Permalink
Merge pull request #93 from TheNewNormal/v1.4.9
Browse files Browse the repository at this point in the history
v1.4.9
  • Loading branch information
rimusz authored Aug 2, 2016
2 parents dc9a4e8 + 75ca7c6 commit a549811
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 122 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ How to install CoreOS VM for macOS

- App's files are installed to `~/coreos-osx` folder
- CoreOS ISO files are stored under `~/.coreos/images` folder
- Mac user home folder can be enabled via `Setup\Enable shared NFS user home folder` to automaticly mounted to VM: `/Users/my_user`:`/Users/my_user` on each VM boot
- Mac user home folder is automaticly mounted via NFS (it has to work on Mac end of course) to `/Users/my_user`:`/Users/my_user` on each VM boot
- macOS `docker` client is installed to `~/coreos-osx/bin` and preset in `OS shell` to be used from there


Expand Down
4 changes: 0 additions & 4 deletions src/CoreOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
133DD1221CE49AB900059FCC /* MainMenu.strings in Resources */ = {isa = PBXBuildFile; fileRef = 133DD1181CE49AB900059FCC /* MainMenu.strings */; };
133DD1231CE49AB900059FCC /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 133DD11A1CE49AB900059FCC /* Images.xcassets */; };
133DD1241CE49AB900059FCC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 133DD11B1CE49AB900059FCC /* main.m */; };
134182F61D2A9DD7001021BD /* enable_disable_nfs.command in Resources */ = {isa = PBXBuildFile; fileRef = 134182F51D2A9DD7001021BD /* enable_disable_nfs.command */; };
134AB3371BD7ECAB00D55BC4 /* upload_docker_images.command in Resources */ = {isa = PBXBuildFile; fileRef = 134AB3361BD7ECAB00D55BC4 /* upload_docker_images.command */; };
137018AC1C11E9D00002B2B9 /* cloud-init in Resources */ = {isa = PBXBuildFile; fileRef = 137018AB1C11E9D00002B2B9 /* cloud-init */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -79,7 +78,6 @@
133DD1191CE49AB900059FCC /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/MainMenu.strings; sourceTree = "<group>"; };
133DD11A1CE49AB900059FCC /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
133DD11B1CE49AB900059FCC /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
134182F51D2A9DD7001021BD /* enable_disable_nfs.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = enable_disable_nfs.command; sourceTree = "<group>"; };
134AB3361BD7ECAB00D55BC4 /* upload_docker_images.command */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = upload_docker_images.command; sourceTree = "<group>"; };
137018AB1C11E9D00002B2B9 /* cloud-init */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "cloud-init"; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -158,7 +156,6 @@
01741B64190DB81400BB1F91 /* up.command */,
0106B3491B65277F001709E0 /* functions.sh */,
01CFC2DB1A2AA48300F251C2 /* change_release_channel.command */,
134182F51D2A9DD7001021BD /* enable_disable_nfs.command */,
01CFC2DC1A2AA48300F251C2 /* destroy.command */,
0145318318FF209D007F9C95 /* ssh.command */,
0111FADA1A7FA2A10021F258 /* os_shell.command */,
Expand Down Expand Up @@ -268,7 +265,6 @@
0145318418FF209D007F9C95 /* ssh.command in Resources */,
01CFC2DF1A2AA48300F251C2 /* destroy.command in Resources */,
133DD1231CE49AB900059FCC /* Images.xcassets in Resources */,
134182F61D2A9DD7001021BD /* enable_disable_nfs.command in Resources */,
133DD11F1CE49AB900059FCC /* CoreOS.entitlements in Resources */,
01741B65190DB81400BB1F91 /* up.command in Resources */,
133DD1221CE49AB900059FCC /* MainMenu.strings in Resources */,
Expand Down
Binary file not shown.
39 changes: 0 additions & 39 deletions src/CoreOS/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -311,20 +311,6 @@ - (IBAction)changeReleaseChannel:(id)sender {
}


- (IBAction)enableNFS:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"CoreOS";
notification.informativeText = @"Enable shared NFS folder";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

NSString *appName = [[NSString alloc] init];
NSString *arguments = [[NSString alloc] init];
[self runApp:appName = @"iTerm" arguments:arguments = [_resoucesPathFromApp stringByAppendingPathComponent:@"enable_disable_nfs.command"]];
}



- (IBAction)destroy:(id)sender {
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
Expand Down Expand Up @@ -452,31 +438,6 @@ - (IBAction)runSsh:(id)sender {
}


- (IBAction)fleetUI:(id)sender {
int vm_status=[self checkVMStatus];
//NSLog (@"VM status:\n%d", vm_status);

if (vm_status == 0) {
NSLog (@"VM is Off");
// send a notification on to the screen
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"CoreOS";
notification.informativeText = @"VM is Off !!!";
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
}
else
{
NSLog (@"VM is On");
NSString *file_path = [NSHomeDirectory() stringByAppendingPathComponent:@"coreos-osx/.env/ip_address"];
// read IP from file
NSString *vm_ip = [NSString stringWithContentsOfFile:file_path
encoding:NSUTF8StringEncoding
error:NULL];
NSString *url = [@[@"http://",vm_ip,@":3000"] componentsJoinedByString:@""];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
}
}

- (IBAction)dockerUI:(id)sender {
int vm_status=[self checkVMStatus];
//NSLog (@"VM status:\n%d", vm_status);
Expand Down
11 changes: 2 additions & 9 deletions src/CoreOS/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<development version="6300" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
Expand Down Expand Up @@ -83,6 +82,7 @@
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="yw0-jk-TL8"/>
<menuItem isSeparatorItem="YES" id="aWh-z2-pQY"/>
<menuItem title="Setup" id="CrJ-Z8-7Tt" userLabel="Menu Item - Setup">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Setup" id="8I2-mE-7PD">
Expand All @@ -94,13 +94,6 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="w1d-Wt-nh1"/>
<menuItem title="Enable/disable shared NFS user home folder" id="7qw-TA-DJZ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="enableNFS:" target="494" id="gW6-MD-nYx"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="np2-EM-hxu"/>
<menuItem title="Destroy VM" id="HWe-7a-OCV">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
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.8</string>
<string>1.4.9</string>
<key>CFBundleVersion</key>
<string>531</string>
<string>533</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
4 changes: 2 additions & 2 deletions src/bin/corevm
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ stop() {


status() {
echo "$(/usr/local/sbin/corectl q -a core-01)"
echo "$(~/bin/corectl q -a core-01)"
}


ip() {
echo "$(/usr/local/sbin/corectl q -i core-01)"
echo "$(~/bin/corectl q -i core-01)"
}


Expand Down
2 changes: 1 addition & 1 deletion src/bin/etcdctl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
res_folder=$(cat ~/coreos-osx/.env/resouces_path)

# get VM's IP
vm_ip=$(/usr/local/sbin/corectl q -i core-01)
vm_ip=$(~/bin/corectl q -i core-01)

cmd=(ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet core@$vm_ip sudo /usr/bin/etcdctl "${@+$@}")

Expand Down
2 changes: 1 addition & 1 deletion src/bin/rkt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
res_folder=$(cat ~/coreos-osx/.env/resouces_path)

# get VM's IP
vm_ip=$(/usr/local/sbin/corectl q -i core-01)
vm_ip=$(~/bin/corectl q -i core-01)

cmd=(ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet core@$vm_ip sudo /usr/bin/rkt "${@+$@}")

Expand Down
2 changes: 1 addition & 1 deletion src/check_vm_status.command
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
res_folder=$(cat ~/coreos-osx/.env/resouces_path)

# check VM status
status=$(/usr/local/sbin/corectl ps 2>&1 | grep "[c]ore-01")
status=$(~/bin/corectl ps 2>&1 | grep "[c]ore-01")

if [ "$status" = "" ]; then
echo -n "VM is stopped"
Expand Down
2 changes: 1 addition & 1 deletion src/destroy.command
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ do
VALID_MAIN=1

# send halt to VM
/usr/local/sbin/corectl halt core-01 > /dev/null 2>&1
~/bin/corectl halt core-01 > /dev/null 2>&1

# delete data image
rm -f ~/coreos-osx/data.img
Expand Down
40 changes: 0 additions & 40 deletions src/enable_disable_nfs.command

This file was deleted.

6 changes: 3 additions & 3 deletions src/first-init.command
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ echo " "
echo "Starting VM ..."
echo " "
#
/usr/local/sbin/corectl load settings/core-01.toml 2>&1 | tee ~/coreos-osx/logs/first-init_vm_up.log
~/bin/corectl load settings/core-01.toml 2>&1 | tee ~/coreos-osx/logs/first-init_vm_up.log
CHECK_VM_STATUS=$(cat ~/coreos-osx/logs/first-init_vm_up.log | grep "started")
#
if [[ "$CHECK_VM_STATUS" == "" ]]; then
Expand All @@ -51,9 +51,9 @@ else
fi

# get VM IP
vm_ip=$(/usr/local/sbin/corectl q -i core-01)
vm_ip=$(~/bin/corectl q -i core-01)
# save VM's IP
/usr/local/sbin/corectl q -i core-01 | tr -d "\n" > ~/coreos-osx/.env/ip_address
~/bin/corectl q -i core-01 | tr -d "\n" > ~/coreos-osx/.env/ip_address
#

echo " "
Expand Down
10 changes: 5 additions & 5 deletions src/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi
function check_corectld_server() {
# check corectld server
#
CHECK_SERVER_STATUS=$(/usr/local/sbin/corectld status 2>&1 | grep "Uptime:")
CHECK_SERVER_STATUS=$(~/bin/corectld status 2>&1 | grep "Uptime:")
if [[ "$CHECK_SERVER_STATUS" == "" ]]; then
open -a /Applications/corectl.app
fi
Expand Down Expand Up @@ -121,13 +121,13 @@ if [ -z "$disk_size" ]
then
echo " "
echo "Creating 15GB sparse disk (QCow2)..."
/usr/local/sbin/qcow-tool create --size=15GiB data.img
~/bin/qcow-tool create --size=15GiB data.img
echo "-"
echo "Created 15GB Data disk"
else
echo " "
echo "Creating "$disk_size"GB sparse disk (QCow2)..."
/usr/local/sbin/qcow-tool create --size="$disk_size"GiB data.img
~/bin/qcow-tool create --size="$disk_size"GiB data.img
echo "-"
echo "Created "$disk_size"GB Data disk"
fi
Expand Down Expand Up @@ -170,7 +170,7 @@ chmod +x ~/coreos-osx/bin/docker
function download_osx_clients() {
# download docker file
# check docker server version
DOCKER_VERSION=$(/usr/local/sbin/corectl ssh core-01 'docker version' | grep 'Version:' | awk '{print $2}' | tr -d '\r' | /usr/bin/sed -n 2p )
DOCKER_VERSION=$(~/bin/corectl ssh core-01 'docker version' | grep 'Version:' | awk '{print $2}' | tr -d '\r' | /usr/bin/sed -n 2p )
# check if the binary exists
if [ ! -f ~/coreos-osx/bin/docker ]; then
cd ~/coreos-osx/bin
Expand Down Expand Up @@ -211,7 +211,7 @@ export PATH=${HOME}/coreos-osx/bin:$PATH
res_folder=$(cat ~/coreos-osx/.env/resouces_path)

# send halt to VM
/usr/local/sbin/corectl halt core-01 > /dev/null 2>&1
~/bin/corectl halt core-01 > /dev/null 2>&1

# kill all other scripts
pkill -f [C]oreOS.app/Contents/Resources/fetch_latest_iso.command
Expand Down
2 changes: 1 addition & 1 deletion src/halt.command
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ res_folder=$(cat ~/coreos-osx/.env/resouces_path)
export PATH=${HOME}/coreos-osx/bin:$PATH

# send halt to VM
/usr/local/sbin/corectl halt core-01
~/bin/corectl halt core-01

2 changes: 1 addition & 1 deletion src/os_shell.command
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ res_folder=$(cat ~/coreos-osx/.env/resouces_path)
ssh-add -K ~/.ssh/id_rsa &>/dev/null

# get VM's IP
vm_ip=$(/usr/local/sbin/corectl q -i core-01)
vm_ip=$(~/bin/corectl q -i core-01)

# path to the bin folder where we store our binary files
export PATH=${HOME}/coreos-osx/bin:$PATH
Expand Down
10 changes: 5 additions & 5 deletions src/reload.command
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo " "
echo "Stopping VM ..."

# send halt to VM
/usr/local/sbin/corectl halt core-01
~/bin/corectl halt core-01

#
sleep 3
Expand All @@ -29,7 +29,7 @@ cd ~/coreos-osx
echo " "
echo "Starting VM ..."
#
/usr/local/sbin/corectl load settings/core-01.toml 2>&1 | tee ~/coreos-osx/logs/vm_reload.log
~/bin/corectl load settings/core-01.toml 2>&1 | tee ~/coreos-osx/logs/vm_reload.log
CHECK_VM_STATUS=$(cat ~/coreos-osx/logs/vm_reload.log | grep "started")
#
if [[ "$CHECK_VM_STATUS" == "" ]]; then
Expand All @@ -43,13 +43,13 @@ else
fi

# check if /Users/homefolder is mounted, if not mount it
/usr/local/sbin/corectl ssh core-01 'source /etc/environment; if df -h | grep ${HOMEDIR}; then echo 0; else sudo systemctl restart ${HOMEDIR}; fi' > /dev/null 2>&1
~/bin/corectl ssh core-01 'source /etc/environment; if df -h | grep ${HOMEDIR}; then echo 0; else sudo systemctl restart ${HOMEDIR}; fi' > /dev/null 2>&1
echo " "

# get VM's IP
vm_ip=$(/usr/local/sbin/corectl q -i core-01)
vm_ip=$(~/bin/corectl q -i core-01)
# save VM's IP
/usr/local/sbin/corectl q -i core-01 | tr -d "\n" > ~/coreos-osx/.env/ip_address
~/bin/corectl q -i core-01 | tr -d "\n" > ~/coreos-osx/.env/ip_address
#

echo "CoreOS VM was reloaded !!!"
Expand Down
1 change: 1 addition & 0 deletions src/settings/core-01.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
memory = "2048"
local = "true"
offline = "true"
shared-homedir = "true"
2 changes: 1 addition & 1 deletion src/ssh.command
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
export PATH=${HOME}/coreos-osx/bin:$PATH

# ssh into VM
/usr/local/sbin/corectl ssh core-01
~/bin/corectl ssh core-01
6 changes: 3 additions & 3 deletions src/up.command
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ echo "Starting VM ..."
echo " "
#
cd $HOME/coreos-osx
/usr/local/sbin/corectl load settings/core-01.toml 2>&1 | tee ~/coreos-osx/logs/vm_up.log
~/bin/corectl load settings/core-01.toml 2>&1 | tee ~/coreos-osx/logs/vm_up.log
#
CHECK_VM_STATUS=$(cat ~/coreos-osx/logs/vm_up.log | grep "started")
#
Expand All @@ -73,9 +73,9 @@ else
fi

# get VM IP
vm_ip=$(/usr/local/sbin/corectl q -i core-01)
vm_ip=$(~/bin/corectl q -i core-01)
# save VM's IP
/usr/local/sbin/corectl q -i core-01 | tr -d "\n" > ~/coreos-osx/.env/ip_address
~/bin/corectl q -i core-01 | tr -d "\n" > ~/coreos-osx/.env/ip_address

# Set the environment variables
# set etcd endpoint
Expand Down
2 changes: 1 addition & 1 deletion src/update_osx_clients_files.command
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source "${DIR}"/functions.sh
res_folder=$(cat ~/coreos-osx/.env/resouces_path)

# get VM's IP
vm_ip=$(/usr/local/sbin/corectl q -i core-01)
vm_ip=$(~/bin/corectl q -i core-01)

# path to the bin folder where we store our binary files
export PATH=${HOME}/coreos-osx/bin:$PATH
Expand Down
2 changes: 1 addition & 1 deletion src/upload_docker_images.command
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ res_folder=$(cat ~/coreos-osx/.env/resouces_path)
export PATH=${HOME}/coreos-osx/bin:$PATH

# get VM's IP
vm_ip=$(/usr/local/sbin/corectl q -i core-01)
vm_ip=$(~/bin/corectl q -i core-01)

# Set the environment variables
# docker daemon
Expand Down

0 comments on commit a549811

Please sign in to comment.