How to configure Genie for production environment? - julia

How can I configure Genie for production? It is creating the application for development environment:
Active env: DEV
Full logs:
[root#srvr0 ~]# julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.4 (2021-11-19)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using Genie
julia> Genie.newapp_mvc("WatchTonight")
Updating registry at `~/.julia/registries/General`
Resolving package versions...
No Changes to `~/.julia/environments/v1.6/Project.toml`
No Changes to `~/.julia/environments/v1.6/Manifest.toml`
Please choose the DB backend you want to use:
1. SQLite
2. MySQL
3. PostgreSQL
4. Other
Input 1, 2, 3 or 4 and press ENTER to confirm
4
Please input DB adapter (ex: Oracle, ODBC, JDBC, etc)
Oracle
Activating environment at `~/Project.toml`
┌ Error: Pkg.Types.PkgError("The following package names could not be resolved:\n * SearchLightOracle (not found in project, manifest or registry)\n")
└ # Genie.Generator ~/.julia/packages/Genie/fMBsZ/src/Generator.jl:503
[ Info: Done! New app created at /root/WatchTonight
[ Info: Changing active directory to /root/WatchTonight
/tmp/jl_Z2oGzp/WatchTonight/Project.toml
[ Info: Project.toml has been generated
[ Info: Installing app dependencies
Activating environment at `~/WatchTonight/Project.toml`
Resolving package versions...
Installed Crayons ────────── v4.1.0
Installed LoweredCodeUtils ─ v2.2.0
Installed JuliaInterpreter ─ v0.9.0
Installed Revise ─────────── v3.3.1
Updating `~/WatchTonight/Project.toml`
[c43c736e] + Genie v4.7.1
[6d011eab] + Inflector v1.0.1
[e6f89c97] + LoggingExtras v0.4.7
[739be429] + MbedTLS v1.0.3
[ade2ca70] + Dates
[56ddb016] + Logging
Updating `~/WatchTonight/Manifest.toml`
[c7e460c6] + ArgParse v1.1.4
[00ebfdb7] + CSTParser v3.3.0
[da1fd8a2] + CodeTracking v1.0.6
[a80b9123] + CommonMark v0.8.5
[34da2185] + Compat v3.41.0
[a8cc5b0e] + Crayons v4.1.0
[864edb3b] + DataStructures v0.18.11
[8f5d6c58] + EzXML v1.1.0
[48062228] + FilePathsBase v0.9.17
[c43c736e] + Genie v4.7.1
[cd3eb016] + HTTP v0.9.17
[77172c1b] + HttpCommon v0.5.0
[6d011eab] + Inflector v1.0.1
[83e8ac13] + IniFile v0.5.0
[692b3bcd] + JLLWrappers v1.3.0
[682c06a0] + JSON v0.21.2
[0f8b85d8] + JSON3 v1.9.2
[98e50ef6] + JuliaFormatter v0.20.5
[aa1ae85d] + JuliaInterpreter v0.9.0
[e6f89c97] + LoggingExtras v0.4.7
[6f1432cf] + LoweredCodeUtils v2.2.0
[739be429] + MbedTLS v1.0.3
[39ec1447] + Millboard v0.2.5
[49dea1ee] + Nettle v0.5.1
[4d1e1d77] + Nullables v1.0.0
[bac558e1] + OrderedCollections v1.4.1
[69de0a69] + Parsers v2.1.3
[21216c6a] + Preferences v1.2.3
[92933f4c] + ProgressMeter v1.7.1
[189a3867] + Reexport v1.2.2
[ae029012] + Requires v1.2.0
[295af30f] + Revise v3.3.1
[6c6a2e73] + Scratch v1.1.0
[69024149] + StringEncodings v0.3.5
[856f2bd8] + StructTypes v1.8.1
[b718987f] + TextWrap v1.0.1
[0796e94c] + Tokenize v0.5.21
[30578b45] + URIParser v0.4.1
[5c2747f8] + URIs v1.3.0
[856ac37a] + UrlDownload v1.0.0
[a637dc6b] + VersionCheck v0.2.0
[ddb6d928] + YAML v0.4.7
[94ce4f54] + Libiconv_jll v1.16.1+1
[4c82536e] + Nettle_jll v3.7.2+0
[02c8fc9c] + XML2_jll v2.9.12+0
[0dad84c5] + ArgTools
[56f22d72] + Artifacts
[2a0f44e3] + Base64
[ade2ca70] + Dates
[8bb1440f] + DelimitedFiles
[8ba89e20] + Distributed
[f43a241f] + Downloads
[7b1f6079] + FileWatching
[b77e0a4c] + InteractiveUtils
[b27032c2] + LibCURL
[76f85450] + LibGit2
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[56ddb016] + Logging
[d6f4376e] + Markdown
[a63ad114] + Mmap
[ca575930] + NetworkOptions
[44cfe95a] + Pkg
[de0858da] + Printf
[3fa0cd96] + REPL
[9a3f8284] + Random
[ea8e919c] + SHA
[9e88b42a] + Serialization
[1a1011a3] + SharedArrays
[6462fe0b] + Sockets
[2f01184e] + SparseArrays
[10745b16] + Statistics
[fa267f1f] + TOML
[a4e569a6] + Tar
[8dfed614] + Test
[cf7118a7] + UUIDs
[4ec0a83e] + Unicode
[781609d7] + GMP_jll
[deac9b47] + LibCURL_jll
[29816b5a] + LibSSH2_jll
[c8ffd9c3] + MbedTLS_jll
[14a3606d] + MozillaCACerts_jll
[83775a58] + Zlib_jll
[8e850ede] + nghttp2_jll
[3f19e933] + p7zip_jll
Precompiling project...
✓ JuliaInterpreter
✓ Crayons
✓ CommonMark
✓ LoweredCodeUtils
✓ JuliaFormatter
✓ Revise
✓ Genie
9 dependencies successfully precompiled in 120 seconds (41 already precompiled)
7 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions
Resolving package versions...
Updating `~/WatchTonight/Project.toml`
[340e8cb6] + SearchLight v2.0.1
Updating `~/WatchTonight/Manifest.toml`
[9a962f9c] + DataAPI v1.9.0
[a93c6f00] + DataFrames v1.3.1
[e2d170a0] + DataValueInterfaces v1.0.0
[59287772] + Formatting v0.4.2
[41ab1584] + InvertedIndices v1.1.0
[82899510] + IteratorInterfaceExtensions v1.0.0
[e1d29d7a] + Missings v1.0.2
[2dfb63ee] + PooledArrays v1.4.0
[08abe8d2] + PrettyTables v1.3.1
[340e8cb6] + SearchLight v2.0.1
[a2af1166] + SortingAlgorithms v1.0.1
[3783bdb8] + TableTraits v1.0.1
[bd369af6] + Tables v1.6.1
[9fa8497b] + Future
Precompiling project...
✓ LoweredCodeUtils
✓ JuliaFormatter
✓ Revise
✓ Genie
6 dependencies successfully precompiled in 105 seconds (57 already precompiled)
4 dependencies precompiled but different versions are currently loaded. Restart julia to access the new versions
Please choose the DB backend you want to use:
1. SQLite
2. MySQL
3. PostgreSQL
4. Other
Input 1, 2, 3 or 4 and press ENTER to confirm
4
Please input DB adapter (ex: Oracle, ODBC, JDBC, etc)
Oracle
Activating environment at `~/WatchTonight/Project.toml`
┌ Error: Pkg.Types.PkgError("The following package names could not be resolved:\n * SearchLightOracle (not found in project, manifest or registry)\n")
└ # Genie.Generator ~/.julia/packages/Genie/fMBsZ/src/Generator.jl:503
[ Info: Installing dependencies for unit tests
Activating new environment at `~/WatchTonight/test/Project.toml`
Resolving package versions...
Updating `~/WatchTonight/test/Project.toml`
[8dfed614] + Test
Updating `~/WatchTonight/test/Manifest.toml`
[2a0f44e3] + Base64
[b77e0a4c] + InteractiveUtils
[56ddb016] + Logging
[d6f4376e] + Markdown
[9a3f8284] + Random
[9e88b42a] + Serialization
[8dfed614] + Test
Activating environment at `~/WatchTonight/Project.toml`
[ Info: Starting your brand new Genie app - hang tight!
[ Info: Precompiling WatchTonight [93f46181-df21-4b6e-b7cd-33e5e979776f]
_____ _
| __|___ ___|_|___
| | | -_| | | -_|
|_____|___|_|_|_|___|
| Web: https://genieframework.com
| GitHub: https://github.com/genieframework/Genie.jl
| Docs: https://genieframework.github.io/Genie.jl/dev
| Gitter: https://gitter.im/essenciary/Genie.jl
| Twitter: https://twitter.com/GenieMVC
Active env: DEV
Ready!
┌ Info: 2022-01-06 10:38:26
└ Web Server starting at http://127.0.0.1:8000

You have 2 easy options:
1/ at the OS terminal, when starting the Genie app, pass the GENIE_ENV="prod" environment variable, like this:
$> GENIE_ENV="prod" bin/repl
2/ switch the application to PROD by default by editing the config/env/global.jl file and adding this line:
ENV["GENIE_ENV"] = "prod"

Related

Check if .NET 5.0 is installed in Inno Setup

I have the following .iss script to compile a games launcher I'm working on that uses .NET 5.0. Currently it tries to install .NET 5.0 from the installer it has every time instead of checking if its required first. I've found plenty of resources that tell you how to do it for the .NET Framework but hardly anything for .NET 5.0 which is a updated version of .NET Core. How do I check if .NET 5.0 is already installed before trying to install it anyway?
I also am aware that 5.0 is nearer end of life but I'm using Visual Studio 2019 which 6.0 isn't compatible with and would prefer not to have to use any work arounds to get 2019 to play ball with it.
#define AppName "LowPoly Games Launcher"
#define AppEXEName "LPG Launcher.exe"
[Setup]
AppName={#AppName}
[Files]
Source: "..\bin\Release\net5.0-windows\*"; DestDir: "{app}"; \
Flags: ignoreversion recursesubdirs;
Source: "Resources\windowsdesktop-runtime-5.0.17-win-x64.exe"; \
DestDir: "{app}"; Flags: ignoreversion deleteafterinstall
[Run]
Filename: "{app}\{#AppEXEName}"; \
Description: "{cm:LaunchProgram, {#StringChange(AppName, '&', '&&')}}"; \
Flags: nowait postinstall
Filename: "{app}\windowsdesktop-runtime-5.0.17-win-x64.exe"; \
Parameters: "/q/passive"; Flags: waituntilterminated; \
StatusMsg: Microsoft .NET Framework 5.0 is being installed. Please wait...
Based on:
How to get an output of an Exec'ed program in Inno Setup?
How to check that .NET is already installed
You can do:
[Code]
function IsDotNetInstalled(DotNetName: string): Boolean;
var
Cmd, Args: string;
FileName: string;
Output: AnsiString;
Command: string;
ResultCode: Integer;
begin
FileName := ExpandConstant('{tmp}\dotnet.txt');
Cmd := ExpandConstant('{cmd}');
Command := 'dotnet --list-runtimes';
Args := '/C ' + Command + ' > "' + FileName + '" 2>&1';
if Exec(Cmd, Args, '', SW_HIDE, ewWaitUntilTerminated, ResultCode) and
(ResultCode = 0) then
begin
if LoadStringFromFile(FileName, Output) then
begin
if Pos(DotNetName, Output) > 0 then
begin
Log('"' + DotNetName + '" found in output of "' + Command + '"');
Result := True;
end
else
begin
Log('"' + DotNetName + '" not found in output of "' + Command + '"');
Result := False;
end;
end
else
begin
Log('Failed to read output of "' + Command + '"');
end;
end
else
begin
Log('Failed to execute "' + Command + '"');
Result := False;
end;
DeleteFile(FileName);
end;
And it use it like:
if IsDotNetInstalled('Microsoft.NETCore.App 5.0.') then // ...

gcloud installation issues in cloudera VM

I am trying to configure gcloud sdk in cloudera VM. Below commands I have used. I have tried to pass python a default parameter in install.sh but stil not working out. Can some one guide me any clean approach.
curl https://sdk.cloud.google.com | bash
1. I have installed python3.7 on the top of existing 2.6
(base) [cloudera#quickstart google-cloud-sdk]$ which python
alias python='/home/cloudera/anaconda3/bin'
(base) [cloudera#quickstart google-cloud-sdk]$ whereis python
python: /usr/bin/python2.6 /usr/bin/python /usr/bin/python2.6-config /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/share/man/man1/python.1.gz
(base) [cloudera#quickstart google-cloud-sdk]$
2. Error Log from sh -x install.sh
+ _cloudsdk_which python2
+ which python2
+ CLOUDSDK_PYTHON=python2
+ unset PYTHONHOME
+ case :$CLOUDSDK_PYTHON_SITEPACKAGES:$VIRTUAL_ENV: in
+ case " $CLOUDSDK_PYTHON_ARGS " in
+ CLOUDSDK_PYTHON_ARGS=-S
+ unset CLOUDSDK_PYTHON_SITEPACKAGES
+ export CLOUDSDK_ROOT_DIR CLOUDSDK_PYTHON_ARGS
+ '[' -z python2 ']'
++ id -u
+ '[' 501 = 0 ']'
+ python2 -S /home/cloudera/google-cloud-sdk/bin/bootstrapping/install.py
Traceback (most recent call last):
File "/home/cloudera/google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module>
import bootstrapping
File "/home/cloudera/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 32, in <module>
import setup # pylint:disable=g-import-not-at-top
File "/home/cloudera/google-cloud-sdk/bin/bootstrapping/setup.py", line 55, in <module>
from googlecloudsdk.core import properties
File "/home/cloudera/google-cloud-sdk/lib/googlecloudsdk/core/properties.py", line 378
self.__sections = {section.name: section for section in sections}
^
3. After hardcoding the python as default.
+ echo Welcome to the Google Cloud 'SDK!'
Welcome to the Google Cloud SDK!
++ _cloudsdk_root_dir install.sh
++ case $1 in
+++ _cloudsdk_which install.sh
+++ which install.sh
+++ command -v install.sh
++ _cloudsdk_path=
++ case $_cloudsdk_path in
++ _cloudsdk_path=/home/cloudera/google-cloud-sdk/
++ _cloudsdk_dir=0
++ :
+++ readlink /home/cloudera/google-cloud-sdk/
++ _cloudsdk_link=
++ case $_cloudsdk_dir in
++ '[' -d /home/cloudera/google-cloud-sdk/ ']'
++ break
++ :
++ case $_cloudsdk_path in
+++ dirname /home/cloudera/google-cloud-sdk//.
++ _cloudsdk_path=/home/cloudera/google-cloud-sdk
++ :
++ case $_cloudsdk_path in
++ echo /home/cloudera/google-cloud-sdk
++ break
+ CLOUDSDK_ROOT_DIR=/home/cloudera/google-cloud-sdk
+ '[' -z '' ']'
+ CLOUDSDK_PYTHON=python
+ unset PYTHONHOME
+ case :$CLOUDSDK_PYTHON_SITEPACKAGES:$VIRTUAL_ENV: in
+ case " $CLOUDSDK_PYTHON_ARGS " in
+ CLOUDSDK_PYTHON_ARGS=-S
+ unset CLOUDSDK_PYTHON_SITEPACKAGES
+ export CLOUDSDK_ROOT_DIR CLOUDSDK_PYTHON_ARGS
+ '[' -z python ']'
++ id -u
+ '[' 501 = 0 ']'
+ python -S /home/cloudera/google-cloud-sdk/bin/bootstrapping/install.py
Traceback (most recent call last):
File "/home/cloudera/google-cloud-sdk/bin/bootstrapping/install.py", line 27, in <module>
from googlecloudsdk import gcloud_main
File "/home/cloudera/google-cloud-sdk/lib/googlecloudsdk/gcloud_main.py", line 37, in <module>
from googlecloudsdk.command_lib.util.apis import yaml_command_translator
File "/home/cloudera/google-cloud-sdk/lib/googlecloudsdk/command_lib/util/apis/yaml_command_translator.py", line 241
if self.spec.async:
^
SyntaxError: invalid syntax
Gcloud SDK works on 2.7 version or later but not python3. I had to install 2.7 and below the steps i performed.
1. Get python2.7 for anaconda
2. Install and provide an alernative path like /home/cloudera/anaconda2/
3. bash Anaconda2-2019.03-Linux-x86_64.sh
4. Update .bash_profile (alias python2.7='/home/cloudera/anaconda2/bin/python2.7')
5. Update CLOUDSDK_PYTHON="python2.7" in /home/cloudera/google-cloud-sdk/install.sh (Need to put after the if loop)
6. Then execute sh -x install.sh
Thanks

Unable to index into an object of type System.Xml.XPathNodeList

Visual Studio 2015 + Framework 4.5 + Nuget Package Manager console + Installing Umbraco7 by the command (Install-Package uCommerce.Umbraco7”) = Getting following error:
Unable to index into an object of type System.Xml.XPathNodeList.
At E:\ShopKart\packages\uCommerce.Umbraco7.8.0.0.18352\tools\install.ps1:59 char:129
+ $perRequestLifestyleHttpModulesElement = $webConfig.SelectNodes("//system.web//httpModules//add[#name='PerRequestLifestyle']")[
<<<< 0]
+ CategoryInfo : InvalidOperation: (0:Int32) [], RuntimeException
+ FullyQualifiedErrorId : CannotIndex
That package does not contain Umbraco 7, it contains UCommerce for Umbraco 7 :-/ Try Install-package UmbracoCms instead?

Incorrect application version. Expected version "XXX"

I have been trying to deploy my symfony2 project on aws elastic-beanstalk, but I keep having this error:
Command failed on all instances.
Incorrect application version found on all instances. Expected version "app-3706-170331_113756" (deployment 6).
.
i-02ac339ff8d24da60 Severe 3 hours 9 - - - - - - - - - - 0.00 0.00 0.1 0.1 99.8 0.0
Application update failed at 2017-03-31T10:40:17Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed.
+ . /opt/elasticbeanstalk/support/envvars
++ export HOME=/root
++ HOME=/root
++ export COMPOSER_HOME=/root
++ COMPOSER_HOME=/root
++ export PHP_MEMORY_LIMIT=2048M
++ PHP_MEMORY_LIMIT=2048M
++ export PHP_MAX_EXECUTION_TIME=4000
++ PHP_MAX_EXECUTION_TIME=4000
++ export PHP_DISPLAY_ERRORS=On
++ PHP_DISPLAY_ERRORS=On
++ export PHP_COMPOSER_OPTIONS=
++ PHP_COMPOSER_OPTIONS=
++ export PHP_ALLOW_URL_FOPEN=On
++ PHP_ALLOW_URL_FOPEN=On
++ export PHP_ZLIB_OUTPUT_COMPRESSION=Off
++ PHP_ZLIB_OUTPUT_COMPRESSION=Off
++ export PHP_DOCUMENT_ROOT=
++ PHP_DOCUMENT_ROOT=
++ export PHP_DATE_TIMEZONE=UTC
++ PHP_DATE_TIMEZONE=UTC
++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
+ EB_APP_STAGING_DIR=/var/app/ondeck
+ cd /var/app/ondeck
+ '[' -f composer.json ']'
+ export COMPOSER_HOME=/root
+ COMPOSER_HOME=/root
+ '[' -d vendor ']'
++ /opt/elasticbeanstalk/bin/get-config optionsettings -n aws:elasticbeanstalk:container:php:phpini -o composer_options
+ PHP_COMPOSER_OPTIONS=
+ echo 'Found composer.json file. Attempting to install vendors.'
Found composer.json file. Attempting to install vendors.
+ composer.phar install --no-ansi --no-interaction
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing twig/twig (v1.27.0)
Loading from cache
- Installing symfony/symfony (v2.8.13)
Loading from cache
- Installing symfony/security-acl (dev-master 053b49b)
Cloning 053b49bf4aa333a392c83296855989bcf88ddad1
Command output has been truncated. Please see logs for more details.
Incorrect application version "app-3706-170331_123438" (deployment 9). Expected version "app-3706-170331_113756" (deployment 6).
I have increased Max execution time up to 4000 and Memory limit up to 2048M.
In .ebextensions I have the following file:
project.config
files:
"/etc/php.d/symfony.ini" :
mode: "000644"
owner: root
group: root
content: |
upload_max_filesize = 256M
post_max_size = 256M
main.config
commands:
01_update_composer:
command: export HOME=/root && export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update 1.0.0-alpha11
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: COMPOSER_HOME
value: /root
- namespace: aws:elasticbeanstalk:application:environment
option_name: HOME
value: /root
01-increase-timeout.config
option_settings:
- namespace: aws:elasticbeanstalk:command
option_name: Timeout
value: 1000

Openstack, devstack installation ERROR: openstackclient.shell Exception

I'm not sure if it's the right place for my question, I am trying to install devstack but I'm getting these errors:
openstackclient.shell Exception
2015-04-21 16:22:04.991 | ERROR: openstackclient.shell Exception raised: (six 1.7.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.9.0'), set(['oslo.i18n', 'oslo.utils', 'cliff']))
2015-04-21 16:22:05.014 | + ADMIN_TENANT=
2015-04-21 16:22:05.015 | ++ openstack user create admin --project '' --email admin#example.com --password openstack
2015-04-21 16:22:05.015 | ++ grep ' id '
2015-04-21 16:22:05.018 | ++ get_field 2
2015-04-21 16:22:05.018 | ++ read data
2015-04-21 16:22:05.447 | ERROR: openstackclient.shell Exception raised: (six 1.7.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.9.0'), set(['oslo.i18n', 'oslo.utils', 'cliff']))
2015-04-21 16:22:05.466 | + ADMIN_USER=
2015-04-21 16:22:05.467 | ++ openstack role create admin
2015-04-21 16:22:05.468 | ++ grep ' id '
2015-04-21 16:22:05.469 | ++ get_field 2
2015-04-21 16:22:05.469 | ++ read data
2015-04-21 16:22:05.897 | ERROR: openstackclient.shell Exception raised: (six 1.7.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.9.0'), set(['oslo.i18n', 'oslo.utils', 'cliff']))
2015-04-21 16:22:05.916 | + ADMIN_ROLE=
2015-04-21 16:22:05.916 | + openstack role add --project --user
2015-04-21 16:22:06.349 | ERROR: openstackclient.shell Exception raised: (six 1.7.3 (/usr/lib/python2.7/dist-packages), Requirement.parse('six>=1.9.0'), set(['oslo.i18n', 'oslo.utils', 'cliff']))
2015-04-21 16:22:06.368 | + exit_trap
2015-04-21 16:22:06.368 | + local r=1
2015-04-21 16:22:06.368 | ++ jobs -p
2015-04-21 16:22:06.368 | + jobs=
2015-04-21 16:22:06.369 | + [[ -n '' ]]
2015-04-21 16:22:06.369 | + exit 1
After some research, typing pip install --upgrade setuptools, but that doesn't work I am using ubuntu 14.10 with no Virtual Machine, Please help?
For the original question, you have version 1.7.3 of six but 1.9.0 is needed. Uninstall six (pip uninstall six), then uninstall devStack (./clean.sh), then re-install devStack (./stack.sh)--but I'd recommend installing Kilo.
As for the "worlddump.py" output, that is just a dump of the state when an error occurs. The actual error will be in the text above this.

Resources