Skip to content

Commit

Permalink
Merge pull request #89 from skycoin/develop
Browse files Browse the repository at this point in the history
Release v0.0.6 is ready to go...!
  • Loading branch information
stdevPavelmc authored Sep 26, 2019
2 parents 735fc3a + ed92691 commit ae21957
Show file tree
Hide file tree
Showing 15 changed files with 665 additions and 188 deletions.
54 changes: 18 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# main build matrix
matrix:
include:
- name: "Xenial Linux with Python 3.6"
Expand All @@ -8,17 +9,13 @@ matrix:
language: python
python:
- "3.6"
before_install:
- python3 --version ; pip3 --version
# Specific OS selection
env: TARGETOS=linux

- name: "macOS with Python 3.7"
os: osx
osx_image: xcode10.2
language: shell
before_install:
- python3 --version ; pip3 --version
env: TARGETOS=osx

- name: "Windows (Wine over Ubuntu Xenial) with Python 3.6"
Expand All @@ -29,61 +26,46 @@ matrix:
language: python
python:
- "3.6"
before_install:
- python3 --version ; pip3 --version
services:
- docker
env: TARGETOS=windows

# install dependencies depending on the OS
# Showing the python3 & pip versions for debug
before_install:
- echo "Getting python & pip version"
- python3 --version
- pip3 --version

# install dependencies depending on the particular OS
install:
- ./travis/install.sh $TARGETOS

# build & test scripts
script:
- make init
- make build

# notifications (only via telegram)
notifications:
email: false
webhooks: https://fathomless-fjord-24024.herokuapp.com/notify

# make the apps for each OS
before_deploy:
- ./travis/before_deploy.sh $TARGETOS
- export VERSION="$(git describe --tags --exact-match HEAD 2> /dev/null)"
- ./travis/before_deploy.sh ${TARGETOS} ${VERSION}
- ls -l ./final/

# deploy step
# deploy to Github
deploy:
# deploy on linux
- provider: releases
api_key: $OAUTH
file_glob: true
file:
- "final/*linux64-static.gz"
draft: true
overwrite: true
skip_cleanup: true
on:
all_branches: true
condition: "$TARGETOS = linux && $TRAVIS_BRANCH =~ ^master$|^release-.*$"

# deploy on macos
- provider: releases
api_key: $OAUTH
file_glob: true
tags: true
file:
- "final/*-app.tgz"
draft: true
skip_cleanup: true
on:
all_branches: true
condition: "$TARGETOS = osx && $TRAVIS_BRANCH =~ ^master$|^release-.*$"

# deploy on windows
- provider: releases
api_key: $OAUTH
file_glob: true
file:
- "final/*.exe"
draft: true
skip_cleanup: true
on:
all_branches: true
condition: "$TARGETOS = windows && $TRAVIS_BRANCH =~ ^master$|^release-.*$"
- "final/*"
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ This is a note for developers about the recommended tags to keep track of the ch
Dates must be YEAR-MONTH-DAY
-->

## v0.0.6 - 2019-09-25

### Changed

- Some UI improvements and fixes: reformat the about box, fix the grammar of a sentences and delay the browser popup after the "new version of skyflash" is detected.
- Configuration load between runs now relays on a config file rather than a dynamic detection (see deprecated section), this for local skybian file and version and app status
- State detection of the app upgraded, now we use a configuration file (skyflash.conf) on the work folder to store the app state and vars
- Deployment and release procedure, see section Added below.
- Name change for the different release apps per OS, the name mask is as follows: Skyflash_${version}_${OS}_${ARCH}.{extension_by_os}, for example: Skyflash_v0.0.5-beta_windows.exe
- Improved the Linux SD card detection code, adding block devices with major type 179 and prevent devices named as mmcblk to being masked by the algorithm even if they are tagged as non removable
- Improved the info shown in the labels next to the 'Browse [skybian image]' and 'Build image' buttons, now with more useful and logic infos
- Status bar infos also updated with more useful info
- Fixed a bug about the build button being disabled if you refuse to use any directory to build the images

### Added

- Now the flashing process shows the write speed and the time left (both as average of the whole flash process)
- Users can now flash already built images upon app start (no more need to re-built to flash)
- Now the deploy into Github happens with just one artifact under a tag and with the 3 apps for the different OS

### Deprecated

- Skyflash image detection from previous runs will be deprecated in version 0.0.7 and forward, we switched to a configparser configuration with a config file

## v0.0.5 - 2019-07-19

### Fixed
Expand Down
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,25 @@ win-flasher-dev: ## Create the flasher tool for windows (no internet needed if y
cd win-build && docker run --rm -v "$(PWDWIN):/src/" pyinstaller-win64py3:skyflash

win: clean win-flasher ## Create a windows static app (for travis only)
mv requirements.txt requirements_lin.txt && cp requirements_win.txt requirements.txt
docker run --rm -v "$(PWD):/src/" cdrx/pyinstaller-windows
mv requirements_lin.txt requirements.txt
cd dist/windows && 7z a skyfwi.7z skyflash-gui/
cp win-build/7zSD.sfx dist/windows/
cp win-build/sfx_config.txt dist/windows/
cd dist/windows && cat 7zSD.sfx sfx_config.txt skyfwi.7z > Skyflash.exe
mv dist/windows/*.exe final/
cd dist/windows && cat 7zSD.sfx sfx_config.txt skyfwi.7z > skyflash.exe
mv dist/windows/skyflash.exe final/
ls -lh final/

win-dev: clean win-flasher-dev ## Create a windows static app using local dev tools (no internet needed if you run "make deps-windows" already)
mv requirements.txt requirements_lin.txt && cp requirements_win.txt requirements.txt
docker run --rm -v "$(PWD):/src/" pyinstaller-win64py3:skyflash
mv requirements_lin.txt requirements.txt
cd dist/windows && 7z a skyfwi.7z skyflash-gui/
cp win-build/7zSD.sfx dist/windows/
cp win-build/sfx_config.txt dist/windows/
cd dist/windows && cat 7zSD.sfx sfx_config.txt skyfwi.7z > Skyflash.exe
mv dist/windows/*.exe final/
cd dist/windows && cat 7zSD.sfx sfx_config.txt skyfwi.7z > skyflash.exe
mv dist/windows/skyflash.exe final/
ls -lh final/

posix-streamer: ## Create the linux/macos streamer to help with the flashing
Expand All @@ -87,14 +91,15 @@ posix-streamer: ## Create the linux/macos streamer to help with the flashing

linux-static: clean posix-streamer ## Create a linux amd64 compatible static (portable) app
python3 -m PyInstaller skyflash-gui.spec
cd dist && gzip skyflash-gui
mv dist/skyflash-gui.gz final/skyflash-gui_linux64-static.gz
cd dist && mv skyflash-gui skyflash && gzip skyflash
mv dist/skyflash.gz final/
ls -lh final/

macos-app: clean posix-streamer ## Create the macos standalone app
python3 -m PyInstaller skyflash-gui.spec
cd dist && tar -cvzf skyflash-app.tgz skyflash-gui.app
mv dist/skyflash-app.tgz final/skyflash-macos-app.tgz
cd dist && mv skyflash-gui.app skyflash.app
cd dist && tar -cvzf skyflash.tgz skyflash.app
mv dist/skyflash.tgz final/
ls -lh final/

help:
Expand Down
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To see more detailed instructions on how to use the Skyflash utility please visi

If you are eager to build it yourself take into account that the base OS for dev is Ubuntu 18.04 LTS, but most of it works on OSX also if you tweak some items _(see notes below)_

The project use the GNU Make to test and build so you can as for help like this `make help`:
The project use the GNU Make to test and build so you can ask for help like this `make help`:

```
$ make help
Expand Down Expand Up @@ -58,32 +58,34 @@ As you can see the options are self explanatory, just a few must know notes:

If you plan to work on the project or just generate your own binaries using travis deploy mechanism you need to follow a few steps to do so.

0. Clone the repository in a personal or org repository (default develop one is at [Simelo organization in Github](https://github.com/simelo/skyflash)) and check travis has take over it and is building it on simple commits from your side.
0. Clone the repository in a personal or organizational repository (default develop one is at [Simelo organization in Github](https://github.com/simelo/skyflash)) and check travis has take over it and is building it on simple commits from your side.
0. Create a [Personal Access Token](https://github.com/settings/tokens) in your Github repository to allow the deploy action on release conditions, copy the token value to the clipboard.
0. Go to your travis builds for this repository and look for the settings, set the token generated as a environment variable named OAUTH

With this settings in place, you can push to the master or release-* branches of your repository and Travis will generate a deploy action on completion to your repository in Github.
With this settings in place, you can push to both local and official repository with no fuzz

### Releases

To do a release you must follow these steps:

0. Clone the repository develop branch in a personal or org repository (default develop one is at [Simelo organization in Github](https://github.com/simelo/skyflash)) follow the above section to configure your repository to produce releases on your repository
0. Clone the repository develop branch in a personal or organizational repository (default develop one is at [Simelo organization in Github](https://github.com/simelo/skyflash)) follow the above section to configure your repository to produce releases on your repository
0. Check if there are commits on the skycoin/master that must be applied to your develop branch (hot fixes or security ones), apply them and fix any merge issues
0. Create a release-v#.#.# branch in your repository from the develop branch, this will be the release playground, the numbers are the next logical release, see [CHANGELOG](CHANGELOG.md) file to see what's next
0. Use your develop branch to hold the latest code and use release-v#.#.# branch to trigger builds in your repository, it will produce (via travis) 3 new draft releases in your github repository each time you commit to it
0. Check any pending issues in order to close them if possible on this release cycle (use local branches and at the end mix them with develop)
0. Update the new version number in the `setup.py`, `skyflash/data/skyflash.qml` & `skyflash/utils.py` files.
0. Update the `CHANGELOG.md` file with any needed info and move the `Unreleased` part to the new release version.
0. Review & update the `README.md` file for any needed updates or changes that need attention in the front page.
0. Push changes to your release-v#.#.# brach and wait for travis to validate all the changes.
0. On success, check the draft release is published on the repository, download the releases files and test them.
0. If problems are found with raise issues where needed (skyflash/skybian) and fix them before continue with the next step.
0. From this point forward work on the release-v#.#.# branch
0. Update the new version number in the `setup.py`, `skyflash/data/skyflash.qml` & `skyflash/utils.py` files
0. Update the `CHANGELOG.md` file with any needed info and move the `Unreleased` part to the new release version
0. Review & update the `README.md` file for any needed updates or changes that need attention in the front page
0. Push changes to your release-v#.#.# brach and wait for travis to validate all the changes
0. Tag the actual point as `Skyflash_v#.#.#-rc` and push this tag to your repository
0. On success, check the draft release is published on the repository, download the releases files and test them
0. If problems are found with raise issues where needed (skyflash/skybian) and fix them before continue with the next step
0. After all problems are solved and work as expected update the `version.txt` file with the version number, like this: v0.0.4
0. Remove the local & remote tag in created in the previous steps
0. Raise a PR against master branch in the skycoin repository, solve any issues and merge it (or wait for a privileged user to do it)
0. Wait for travis completion and check the release files are published on the Github repository under releases.
0. Edit & comment the release with the changes in CHANGELOG.md that match this release, change status from Draft to Official release.
0. Merge master into develop.
0. After solving the issues and travis validation of them, tag the actual point with the version number you wrote on the version.txt and push it
0. Waith for deploy to finish, go to Github and edit & comment the release with the changes in CHANGELOG.md that match this release, change status from Draft to Official release
0. Merge master into develop
0. Check if there is needed to raise issues & PR on the following repositories:

* [Skybian](https://github.com/skycoin/skybian): if needed.
Expand Down
24 changes: 14 additions & 10 deletions USER_MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If the app finds any problem on any of this two operations (mainly due to corrup

### About folders and magic

We incorporated a magic effect into Skyflash to ease your life, go & close the app at this point and re-open it... you will see it knows that it has already a Skybian base image and it will show ready for steps #2 & #3
We incorporated a magic effect into Skyflash to ease your life, go & close the app at this point and re-open it... you will see it knows that it has already a Skybian base image and it will show ready for next steps.

The magic resides in the Skyflash app folder, once you run it for the first time it will create a folder named Skyflash in a specific place depending on your OS:

Expand All @@ -60,11 +60,13 @@ The magic resides in the Skyflash app folder, once you run it for the first time
| Linux | ~/Skyflash | Inside your home directory |
| MacOS | ~/Skyflash | Inside your home directory |

Please take a moment to find this folder, inside it you will find at least a `Downloads` folder and a file called Skyflash.log
Please take a moment to find this folder, inside it you will find at least this:

Mac OS users may get confused as some times there is no Home directory bookmark in finder, simply search for the Documents folder in Finder and press `cmd + up key` that's your home folder, now you can drag it to the bookmarks; inside it you will see a Skyflash folder.
- A `Downloads` folder: here will reside the downloaded Skybian image, it's extracted image and checksums
- A file called `skyflash.log`: this is the log of actions with debug info in case of troubles or if reporting a bug
- A file called `skyflash.conf`: this file holds the configurations state of the software between runs

The download folder is the place where the app put the downloaded & extracted base images plus some other files, the Skyflash.log file is just that: the log file for all operations & you will love it if you get in trouble at some point.
Mac OS users may get confused as some times there is no Home directory bookmark in finder, simply search for the Documents folder in Finder and press `cmd + up` and that's your home folder, now you can drag it to the bookmarks; inside it you will see a Skyflash folder.

This folder will also be the default place for your custom Skybian images _(you can change this later)_, so don't forget it.

Expand Down Expand Up @@ -115,9 +117,9 @@ When this process finish you will have the images in your selected Skybian folde

![Ready to flash the images](/images/flashing-start.png)

You may want to flash the image now or later, if you want to do it now then you may follow the steps below, if not we recommend [BalenaEtcher](https://www.balena.io/etcher/) a multi-platform flashing tool that will do the task once you have the images generated.
The flash process can be done now or later, simply close the app and re-open it, it will pick up where it left.

**A word of warning:** once you generate the images and close Skyflash you will not be able to use Skyflash to burn the same images unless you re-generate the images. For this reason we recommend to have a copy of BalenaEtcher at hand to burn the previously generated images.
But a word of warning here: if you build more than one set of images with different configs _(for example for two different miners with different network configs)_ Skyflash will only remember the las one used. if it's your case we recommend to have a copy of BalenaEtcher at hand to burn the generated images not remembered by skyflash

To start the flashing process you need to select the proper device, and image in the combo boxes, but first a needed warning:

Expand All @@ -137,12 +139,14 @@ Once the flashing of that device ends a popup dialog will explain that you can n

### SD Cards and flash process duration

The flash process depends on the speed of your SD card, using Class 10 or higher class cards is mandatory or you will risk your data with an failed card due to wear out or experience low performance.
The flash process time depends on the speed of your SD card & hardware, using Class 10 or higher uSD cards is mandatory or you will risk your data with a failed card due to wear out or experience low performance, also some cheap USB uSD card adapters are prone to have low speeds

But yes, flashing one card can take about 3 to 5 minutes depending on flash class & specs.
The status bar shows you the write speed and the estimate time left _(check the image above)_ the example image is taken while flashing a card via a USB-C hub from Lenovo with a A-DATA Class 10 uSD card, top hardware speed is reached as you can see, as usual you experience may vary

Flashing one card can take about 2 to 6 minutes depending on flash class & hardware specs, again the speed limit is always set by the hardware used

## Why skyflash ask for credentials or privileged operations?

Flashing to a uSD Card is a privileged operation and Skyflash has built a mechanism to get that privileges at some point.
Flashing an image to a uSD Card is a privileged operation and Skyflash has built a mechanism to get that privileges at some point

Depending on your operating system you will see a credential asking box sooner or later, in Windows the privilege asking happens at the start of the app, on Linux on the start of each flash operation.
Depending on your operating system you will see a credential asking box sooner or later, in Windows the privilege asking happens at the start of the app, on Linux/osx on the start of each flash operation
Binary file modified images/flashing-in-progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ PyQt5 >= 5.12.1
PyQt5-sip >= 4.19.15
sip >= 4.19.6
wmi >= 1.4.8
pywin32 >= 223
requests >= 2.18.0

# there is another dependency for windows only
# see requirements_win.txt (pywin32 >= 223)
7 changes: 7 additions & 0 deletions requirements_win.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PyQt5 >= 5.12.1
PyQt5-sip >= 4.19.15
sip >= 4.19.6
wmi >= 1.4.8
requests >= 2.18.0
# This dependency is only for windows, it crash the process in osx/linux
pywin32 >= 223
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

setup(
name='skyflash',
version="0.0.5",
version="0.0.6",
description='Skycoin Skyminer\'s OS configuring and flashing',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
12 changes: 6 additions & 6 deletions skyflash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from skyflash.skyflash import Skyflash
from skyflash.utils import *

# define the QT5 app at a higher level to get caught at the end bt the garbage collector.
# define the QT5 app at a higher level to get caught at the end by the garbage collector.
QTapp = QGuiApplication(sys.argv)

# define org and name
Expand Down Expand Up @@ -74,11 +74,11 @@ def app():
print("Can not find the icon of the app.")

# main workspace, skyflash object
path, download, checked = setPath("Skyflash")
skyflash.localPath = path
workpath, download, config_file = setPath("Skyflash")
skyflash.localPath = workpath
skyflash.localPathBuild = skyflash.localPath
skyflash.localPathDownloads = download
skyflash.checked = checked
skyflash.config_file = config_file

# init the logging.
skyflash.logStart()
Expand Down Expand Up @@ -119,8 +119,8 @@ def app():
# connect the engine
engine.quit.connect(QTapp.quit)

# check to see if we can load a previous downloaded & tested image
skyflash.loadPrevious()
# load or create the config file.
skyflash.get_config()

# check for updates
skyflash.checkForUpdates()
Expand Down
Loading

0 comments on commit ae21957

Please sign in to comment.