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

Ensure native executable generated in Windows is done using .spec files #526

Merged
merged 1 commit into from
Jul 21, 2017

Conversation

fsat
Copy link
Contributor

@fsat fsat commented Jul 21, 2017

No description provided.

@fsat
Copy link
Contributor Author

fsat commented Jul 21, 2017

Manual test using Windows VM is completed successfully.

Prior this PR, the conduct native executable won't build due to exceptions caused by the incorrect import in the boto hooks within PyInstaller. The workaround is placed in conduct.spec, but since conduct.spec is overwritten, the workaround is removed, and the conduct native executable failed to build.

After this PR, the Windows build works as expected.


C:\Users\IEUser\Workspace\conductr-cli>package-native-zip.bat 1.2.17

C:\Users\IEUser\Workspace\conductr-cli>echo off

Building conductr-cli-1.2.17-Win32.zip

------------------------------------------------
Creating single executable for 'conduct' command
------------------------------------------------

109 INFO: PyInstaller: 3.2.1
109 INFO: Python: 3.5.2
109 INFO: Platform: Windows-7-6.1.7601-SP1
109 INFO: UPX is not available.
109 INFO: Extending PYTHONPATH with paths
['C:\\Users\\IEUser\\Workspace\\conductr-cli',
 'C:\\Users\\IEUser\\Workspace\\conductr-cli']
109 INFO: checking Analysis
171 INFO: checking PYZ
203 INFO: checking PKG
234 INFO: Building because C:\Users\IEUser\Workspace\conductr-cli\build\conduct\
conduct.exe.manifest changed
234 INFO: Building PKG (CArchive) out00-PKG.pkg
2828 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
2859 INFO: Bootloader c:\users\ieuser\appdata\local\programs\python\python35-32\
lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
2859 INFO: checking EXE
2859 INFO: Rebuilding out00-EXE.toc because conduct.exe missing
2859 INFO: Building EXE from out00-EXE.toc
2859 INFO: Appending archive to EXE C:\Users\IEUser\Workspace\conductr-cli\dist\
conduct.exe
2875 INFO: Building EXE from out00-EXE.toc completed successfully.
------------------------------------------------
Creating single executable for 'shazar' command
------------------------------------------------

93 INFO: PyInstaller: 3.2.1
93 INFO: Python: 3.5.2
93 INFO: Platform: Windows-7-6.1.7601-SP1
109 INFO: UPX is not available.
109 INFO: Extending PYTHONPATH with paths
['C:\\Users\\IEUser\\Workspace\\conductr-cli',
 'C:\\Users\\IEUser\\Workspace\\conductr-cli']
109 INFO: checking Analysis
125 INFO: checking PYZ
125 INFO: checking PKG
140 INFO: Building because C:\Users\IEUser\Workspace\conductr-cli\build\shazar\s
hazar.exe.manifest changed
140 INFO: Building PKG (CArchive) out00-PKG.pkg
1562 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
1562 INFO: Bootloader c:\users\ieuser\appdata\local\programs\python\python35-32\
lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
1562 INFO: checking EXE
1562 INFO: Rebuilding out00-EXE.toc because shazar.exe missing
1562 INFO: Building EXE from out00-EXE.toc
1562 INFO: Appending archive to EXE C:\Users\IEUser\Workspace\conductr-cli\dist\
shazar.exe
1578 INFO: Building EXE from out00-EXE.toc completed successfully.
------------------------------------------------
Creating single executable for 'bndl' command
------------------------------------------------

109 INFO: PyInstaller: 3.2.1
109 INFO: Python: 3.5.2
109 INFO: Platform: Windows-7-6.1.7601-SP1
109 INFO: UPX is not available.
109 INFO: Extending PYTHONPATH with paths
['C:\\Users\\IEUser\\Workspace\\conductr-cli',
 'C:\\Users\\IEUser\\Workspace\\conductr-cli']
125 INFO: checking Analysis
140 INFO: checking PYZ
171 INFO: checking PKG
171 INFO: Building because C:\Users\IEUser\Workspace\conductr-cli\build\bndl\bnd
l.exe.manifest changed
171 INFO: Building PKG (CArchive) out00-PKG.pkg
1640 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
1640 INFO: Bootloader c:\users\ieuser\appdata\local\programs\python\python35-32\
lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
1640 INFO: checking EXE
1640 INFO: Rebuilding out00-EXE.toc because bndl.exe missing
1640 INFO: Building EXE from out00-EXE.toc
1640 INFO: Appending archive to EXE C:\Users\IEUser\Workspace\conductr-cli\dist\
bndl.exe
1656 INFO: Building EXE from out00-EXE.toc completed successfully.
------------------------------------------------
Validating version for 'conduct' command
------------------------------------------------

------------------------------------------------
Checking 'conduct' command is working as expected
------------------------------------------------

Licensed To: cc64df31-ec6b-4e08-bb6b-3216721a56b@lightbend
Max ConductR agents: 10
ConductR Version(s): 0.1.0, 2.1.*
Grants: akka-sbr, cinnamon, conductr

ID       NAME                   TAG  #REP  #STR  #RUN  ROLES
870ee7d  continuous-delivery  2.1.0     1     0     1  continuous-delivery
57e432d  eslite               2.1.0     1     0     1  elasticsearch
------------------------------------------------
Checking 'shazar' command is working as expected
------------------------------------------------

usage: shazar-script.py [-h] [-o [OUTPUT]] [--output-dir OUTPUT_DIR] [--tar]
                        [source]

Package a bundle directory or bundle configuration file

positional arguments:
  source                Optional path to a bundle directory or bundle
                        configuration file or tar file.

optional arguments:
  -h, --help            show this help message and exit
  -o [OUTPUT], --output [OUTPUT]
                        The target output file
  --output-dir OUTPUT_DIR
                        When provided with a directory name to package, the
                        directory to write the bundle to, defaults to '.'
  --tar                 If provided, source is decoded as a tar file
------------------------------------------------
Checking 'bndl' command is working as expected
------------------------------------------------

usage: bndl [-h] [-f {bundle,configuration,docker,oci-image}] [--no-shazar]
            [-o [OUTPUT]] [--annotation ANNOTATIONS] [--component COMPONENT]
            [--compatibility-version [COMPATIBILITY_VERSION]]
            [--description DESCRIPTION] [--disk-space [DISK_SPACE]] [--env]
            [--image-tag IMAGE_TAG] [--image-name IMAGE_NAME]
            [--memory [MEMORY]] [--name [NAME]] [--no-default-check]
            [--no-default-endpoints] [--no-default-volumes]
            [--nr-of-cpus [NR_OF_CPUS]] [--role ROLES]
            [--start-command START_COMMAND] [--system [SYSTEM]]
            [--system-version [SYSTEM_VERSION]] [--tag TAGS]
            [--validation-exclude {property-names,required}]
            [--version [VERSION]] [--volume NAME=MOUNT-POINT]
            [--with-defaults {akka,generic,lagom,play}]
            [--check CHECK_ADDRESSES [CHECK_ADDRESSES ...]]
            [--connection-timeout CHECK_CONNECTION_TIMEOUT]
            [--initial-delay CHECK_INITIAL_DELAY] [--endpoint ENDPOINT]
            [--bind-protocol BIND_PROTOCOL] [--bind-port BIND_PORT]
            [--service-name SERVICE_NAME] [--acl ACL] [--path] [--path-beg]
            [--path-regex] [--rewrite REWRITE]
            [source]

Create or modify a bundle

positional arguments:
  source                Optional path to a directory or tar file
                        When absent, stdin is used

optional arguments:
  -h, --help            show this help message and exit
  -f {bundle,configuration,docker,oci-image}, --format {bundle,configuration,doc
ker,oci-image}
                        The input format
                        When absent, auto-detection is attempted
                        The format configuration needs to be specified because i
t cannot be auto-detected.
  --no-shazar           If enabled, a bundle will not be run through shazar
  -o [OUTPUT], --output [OUTPUT]
                        The target output file
                        When absent, stdout is used
  --annotation ANNOTATIONS
                        Annotations to add to bundle.conf
                        Example: bndl --annotation my.first=value1 --annotation
my.second=value2
                        Defaults to []
  --component COMPONENT
                        Specify the component that should be modified
                        Required when the bundle has more than one component
                        Used in conjunction with the following: --description, -
-endpoint, --start-command, --volume
  --compatibility-version [COMPATIBILITY_VERSION]
                        Sets the "compatibilityVersion" bundle.conf value
  --description DESCRIPTION
                        Sets "description" for a component
                        If the bundle has more than one component, you must spec
ify --component
                        Example: bndl --description "My service" --component ser
vice
  --disk-space [DISK_SPACE]
                        Sets the "diskSpace" bundle.conf value
  --env                 Additional environment variables for the bundle's runtim
e-config.sh
                        Defaults to []
  --image-tag IMAGE_TAG
                        The name of the tag to create a ConductR bundle from
                        For use with docker and oci-image formats
                        When absent, the first tag present is used
  --image-name IMAGE_NAME
                        The name of the image to create a ConductR bundle from
                        For use with docker and oci-image formats
                        When absent, the first image present is used
  --memory [MEMORY]     Sets the "memory" bundle.conf value
  --name [NAME]         Sets the "name" bundle.conf value
  --no-default-check    If provided, a bundle will not contain a default check c
ommand
                        For use with docker and oci-image formats
  --no-default-endpoints
                        If provided, a bundle will not contain endpoints for Exp
osedPorts
                        For use with docker and oci-image formats
  --no-default-volumes  If provided, a bundle will not contain any volume declar
ations
                        For use with docker and oci-image formats
  --nr-of-cpus [NR_OF_CPUS]
                        Sets the "nrOfCpus" bundle.conf value
  --role ROLES          Roles to add to the bundle.confExample: bndl --role back
end --role web
                        Defaults to []
  --start-command START_COMMAND
                        Sets "start-command" for a component
                        Must be specified in HOCON format
                        If the bundle has more than one component, you must spec
ify --component
                        Example: bndl --start-command '["/my/app", "my arg"]' --
component service
  --system [SYSTEM]     Sets the "system" bundle.conf value
  --system-version [SYSTEM_VERSION]
                        Sets the "systemVersion" bundle.conf value
  --tag TAGS            Tags to add to bundle.conf
                        Example: bndl --tag 16.04 --tag xenial
                        Defaults to []
  --validation-exclude {property-names,required}
                        If provided, skips a given validation rule
                        The following validation rules can be skipped:
                          empty-property: Checks that the bundle.conf properties
 are not empty
                          property-name: Checks that the bundle.conf only contai
ns property names that are known by ConductR
                          required: Checks that the bundle.conf contains all req
uired properties
                        By default, no validation rule is excluded
  --version [VERSION]   Sets the "version" bundle.conf value
  --volume NAME=MOUNT-POINT
                        Declare a volume path for a component given its name and
 mount point separated by an equals sign
                        For use with oci-image, oci-bundle and docker components

                        If the bundle has more than one component, you must spec
ify--component
                        If provided, existing volumes are removed
                        Example: bndl --volume my-vol=/data --component web
  --with-defaults {akka,generic,lagom,play}
                        Sets default properties in the bundle.conf for a given a
pplication type.
                        Example: bndl --with-defaults lagom
                        Declaring a bndl argument, that specifies a bundle.conf
property such as --memory, is overriding the default property
                        If absent, and the bndl format is "docker" or "oci-image
", --with-defaults is set to "generic"If absent, and the bndl format is somethin
g different, --with-defaults is NoneIf set to None, no default properties are ad
ded

check:
  --check CHECK_ADDRESSES [CHECK_ADDRESSES ...]
                        Check command that is added to the bundle
                        Specify one or multiple addresses that are used to check
 for bundle connectivity
                        As an address, environment variables can be specified th
at are available during Bundle startup, e.g. $MY_BUNDLE_HOST
                        If specified, the existing check command is removed
                        Example: bndl --check \$WEB_BUNDLE_HOST \$BACKEND_BUNDLE
_HOST
                        Accepted address formats:
                          \$ENV/<path>?<params>
                          [docker+]http://<address>:<port>/<path>?<params>
                          [docker+]tcp://<address>:<port>?<params>
                        Accepted params:
                          retry-count=<int> - Number of retries
                          retry-delay=<int> - Delay in seconds between retries
                          docker-timeout=<int> - Timeout in seconds for docker c
ontainer start
  --connection-timeout CHECK_CONNECTION_TIMEOUT
                        Connection timeout in seconds
                        Used in conjunction with the --check option
  --initial-delay CHECK_INITIAL_DELAY
                        Initial delay in seconds
                        Used in conjunction with the --check option

endpoints:
  Add endpoints to the bundle. If the bundle has more than one component, you mu
st specify --component

  --endpoint ENDPOINT   Endpoints that are added to the bundle
                        If specified, existing endpoints are removed
                        Example: bndl --endpoint web --component web --bind-prot
ocol http --service-name web --acl http:/subpath
  --bind-protocol BIND_PROTOCOL
                        Bind protocol of an endpoint
                        Used in conjunction with the --endpoint option
                        When absent, tcp is used
  --bind-port BIND_PORT
                        Bind port of an endpoint
                        Used in conjunction with the --endpoint option
                        When absent, 0 is used, meaning a bind port is selected
by ConductR
  --service-name SERVICE_NAME
                        Service name of an endpoint
                        Used in conjunction with the --endpoint option
                        When absent, the endpoint is not locatable via the servi
ce name
  --acl ACL             Request ACL of an endpoint
                        Used in conjunction with the --endpoint option
                        When absent, the endpoint will not be accessible via the
 Proxy
  --path                If provided, a path must equal the provided string for t
he ACL to match
                        Used in conjunction with the --acl option
  --path-beg            If provided, a path must begin with the provided string
for the ACL to match
                        Used in conjunction with the --acl option
  --path-regex          If provided, a path must match the provided regular expr
ession string for the ACL to match
                        Used in conjunction with the --acl option
  --rewrite REWRITE     If provided, specifies a rewrite value for the ACL
                        Used in conjunction with the --acl option
------------------------------------------------
Building zip archive for conductr-cli-1.2.17-Win32.zip
------------------------------------------------


7-Zip [32] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04

Scanning the drive:
3 files, 25237105 bytes (25 MiB)

Creating archive: conductr-cli-1.2.17-Win32.zip

Items to compress: 3


Files read from disk: 3
Archive size: 24839559 bytes (24 MiB)
Everything is Ok
------------------------------------------------
Success
------------------------------------------------
Created archive in dist/conductr-cli-1.2.17-Win32.zip

Also the .spec files are not modified after changes done in this PR.

@fsat fsat merged commit 2f6ef7e into typesafehub:master Jul 21, 2017
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

1 participant