Spinnaker: How to bring custom boms into spinnaker pod to be able to deploy it with hal? - spinnaker

I would like to provide a custom BOM (Bill of Materials) to spinnaker so that I can configure the repos according to my needs. I am new to k8s, helm and spinnaker and altought reading the docu there are some things not entirely clear how to do that...
Problem
I do not have access to the gcs store nor do I have direct access to external repos. So I need to configure the artifactSources accordingly
According to the docu I guess I should provide a custom bom in a way that they be read from the filesystem - so inside the container spinnaker-spinnaker-halyard-0
My steps
Prepare kubernetes cluster
I do the initial deployment with helm something like
helm install stable/spinnaker --name=spinnaker --namespace=spinnaker -f values.yml
After I connect to the spinnaker-spinnaker-halyard-0 pod and run
$ kubectl.exe exec -it spinnaker-spinnaker-halyard-0 -n spinnaker bash
Deploy Spinnaker
According to the docu here and here I would do do something like
$ hal config version edit --version local:1.11.6
$ hal deploy apply
Which fails obviously cause there is no local bom file
Problems in Global:
! ERROR Unable to retrieve the Spinnaker bill of materials for
version "local:1.11.6": /home/spinnaker/.hal/.boms/bom/1.11.6.yml (No such file
or directory)
- Failed to prep Spinnaker deployment
Question: How to provide custom BOM?
According to the docu the boms are expected to be in a specific directory and structure ${HALCONFIG_DIR}/.boms/boms/${VERSION}.yml
So how to I get my custom POM there? When I look at the helm-chart I don't see (or understand) how I could do that e.g. via additional-config-maps

I found a way but it is manually done, working within the spinnaker-spinnaker-halyard container. I'm sure there is a better way...
I add a custom bom as additionalConfigMap to the values.yml file
...
additionalConfigMaps:
create: true
data:
# https://storage.googleapis.com/halconfig/bom
bom_1.12.4.yml: |
version: 1.12.4
timestamp: '2019-03-01 08:06:24'
services:
echo:
version: 2.3.1-20190214121429
commit: 5db9d437ca7f2fa374dcada17f77bbbb2965bd67
clouddriver:
version: 4.3.4-20190301030607
commit: b5539c47aad309e24428abb8f8303aff45323b43
deck:
version: 2.7.4-20190228030607
commit: dccdd730886a6beb0388e3622581d8da1ed8edbb
fiat:
version: 1.3.2-20190128153726
commit: daf21b24330a5f22866601559aa0f7ac99590274
front50:
version: 0.15.2-20190222161456
commit: 3105e86b8c084ad6ad78507e3a5e5a427f290b99
gate:
version: 1.5.2-20190301030607
commit: b238ab993ab25381ce907260879548ed74a4953f
igor:
version: 1.1.1-20190213190226
commit: 63d06a5c5d55f07443dd60a81035b35cf96238e7
kayenta:
version: 0.6.1-20190221030610
commit: 81d906bf8307143f40fe88f8554baa318de25ef1
orca:
version: 2.3.1-20190220030610
commit: bad45e78566449117b678a3317552cf53d0dd14e
rosco:
version: 0.9.0-20190123170846
commit: 42f81a2501de6d40676d47661579a6106b5c3e8a
defaultArtifact: {}
monitoring-third-party:
version: 0.11.2-20190222030609
commit: 232c84a8a87cecbc17f157dd180643a8b2e6067a
monitoring-daemon:
version: 0.11.2-20190222030609
commit: 232c84a8a87cecbc17f157dd180643a8b2e6067a
dependencies:
redis:
version: 2:2.8.4-2
consul:
version: 0.7.5
vault:
version: 0.7.0
artifactSources:
debianRepository: https://nexus.intra/repository/spinnaker-releases/
dockerRegistry: nexus.intra:5000/spinnaker-marketplace
googleImageProject: marketplace-spinnaker-release
gitPrefix: https://scm.intra/scm/SPIN/repos
Then link the custom bom in the halyard container, configure the version and run the deployment
mkdir -p ~/.hal/.boms/bom
ln -s /opt/halyard/additionalConfigMaps/bom_1.12.4.yml ~/.hal/.boms/bom/1.12.4.yml
hal config version edit --version local:1.12.4
hal deploy apply

Related

Building libjpeg-turbo with conan fails on windows

I am trying to build libjpeg-turbo package with conan on Windows:
conan install libjpeg-turbo/1.5.2#bincrafters/stable
But it fails with:
libjpeg-turbo/1.5.2#bincrafters/stable: Not found in local cache, looking in remotes...
libjpeg-turbo/1.5.2#bincrafters/stable: Trying with 'conan-center'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
....
ERROR: libjpeg-turbo/1.5.2#bincrafters/stable: Error in configure() method, line 43
if self.settings.os == "Emscripten":
ConanException: Invalid setting 'Emscripten' is not a valid 'settings.os' value.
Possible values are ['Android', 'Arduino', 'FreeBSD', 'Linux', 'Macos', 'SunOS', 'Windows', 'WindowsStore', 'iOS', 'tvOS', 'watchOS']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
The same command on Linux works fine.
On both system I have conan in version 1.21.0
I cannot find any clue about this error.
EDIT
Here is full output of libjpeg-turbo in version 2.0.2 installation:
>conan install -r conan-center libjpeg-turbo/2.0.2#
Configuration:
[settings]
arch=x86
arch_build=x86
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=15
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
ERROR: libjpeg-turbo/2.0.2: Error in configure() method, line 49
if self.settings.os == "Emscripten":
ConanException: Invalid setting 'Emscripten' is not a valid 'settings.os
' value.
Possible values are ['Android', 'Arduino', 'FreeBSD', 'Linux', 'Macos', 'SunOS',
'Windows', 'WindowsStore', 'iOS', 'tvOS', 'watchOS']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-sett
ing"
The Conan package libjpeg-turbo/1.5.2#bincrafters/stable is obsolete and has been replaced by libjpeg-turbo/2.0.2#. You can obtain that package from Conan Center as well:
conan install -r conan-center libjpeg-turbo/2.0.2#
Now about your error:
ConanException: Invalid setting 'Emscripten' is not a valid 'settings.os' value.
As you can see, your current settings.os is configured as Emscripten which is not supported by that recipe. As the FAQ link indicates, you should customize your current settings, thus you can try:
conan install -r conan-center libjpeg-turbo/2.0.2# -s os=Windows
Thus, you should:
Update your current package to libjpeg-turbo/2.0.2# (it requires Conan >=1.18)
Update your current profile to Windows:
conan profile update settings.os=Windows default
If you really need Emscripten, so open an issue to Conan Center Index requesting such feature.
Regards!

How is the correct syntax/call to get the sls-file working - salt

I'm trying to build a reactor sls file, which starts running when an event occurs.
The content of the sls file should be as the following cli commands:
sudo salt minion git.add /srv/salt .
sudo salt minion git.commit /srv/salt test
sudo salt minion git.push /srv/salt origin master identity=/home/autogit/.ssh/id_rsa
If i run the code bellow triggered by the reactor. I get the following error message.
[DEBUG ] Reactor is populating module client cache
[ERROR ] An un-handled exception from the multiprocessing process 'Reactor-9:1' was caught:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/process.py", line 765, in _run
return self._original_run()
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 271, in run
self.call_reactions(chunks)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 228, in call_reactions
self.wrap.run(chunk)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 330, in run
self.populate_client_cache(low)
File "/usr/lib/python2.7/dist-packages/salt/utils/reactor.py", line 324, in populate_client_cache
self.reaction_class[reaction_type](self.opts['conf_file'])
KeyError: u'module'
[CRITICAL] Engine 'reactor' could not be started!
I've tried different syntax (old style and new style) but couldn't figure out what the problem is. Always getting an KeyError: u'module' or u'git'.
Also tried it with runner function to run it locally on the master.
git pull:
module.run:
- git.pull:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- identity: /home/autogit/.ssh/id_rsa
- git.add:
- cwd: /srv/salt
- filename: .
- git.commit:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- git.push:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/sbt.git
- identity: /home/autogit/.ssh/id_rsa
salt --versions-report
Salt Version:
Salt: 2019.2.0
Dependency Versions:
cffi: Not Installed
cherrypy: unknown
dateutil: 2.6.1
docker-py: Not Installed
gitdb: 2.0.3
gitpython: 2.1.8
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.7
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
python-gnupg: 0.4.1
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: 2.0.3
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.5
System Versions:
dist: Ubuntu 18.04 bionic
locale: UTF-8
machine: x86_64
release: 4.15.0-46-generic
system: Linux
version: Ubuntu 18.04 bionic
Since i'm quite new to Salt, hopefully you can give me a hint what i'm doing wrong:
You didn't provide the master config.
About module.run confusion: add in your settings (minion and maybe to master since I don't know your use-case)
use_superseded:
- module.run
That will enable your syntax, more doc about this here: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html#salt.states.module.run
In general: you are executing execution modules from the place that state modules are allowed only (the term module is heavily overused in salt...)
You didn't provide the full Master config. Reactor requires dedicated config to match events to sls files:
https://docs.saltstack.com/en/latest/ref/configuration/master.html#master-reactor-settings
You can also check the doc I've written some time ago about events and reactors:
https://github.com/kiemlicz/util/wiki/Salt-Events-and-Reactor
Assuming you've configured your events-to-sls-files-matching in master config, your provided sls:
git pull:
module.run:
- git.pull:
- cwd: /srv/salt
- remote: git#git.xyz.com:user/
...
will not work.
Mind that reaction happens on Salt Master thus the reaction sls file need to provide type of reaction (local, runner etc.) since it's no longer 'view of one minion' but possibly of tons of minions!
First create runner reaction type (which delegates to some orchestration sls file which will contain your logic wrapped with (I think) salt.function )
Help yourself with aforementioned github link to my attempt of explaining Reactor.
Refer to official doc as well: https://docs.saltstack.com/en/latest/topics/reactor/index.html

Trying to install apache on CentOS7 using Chef

I'm trying to use Chef on CentOS7 and I'm at the beginning ... following the tutorial I0m trying to install apache using this recipe.
package 'apache2' do
action :install
end
service 'apache2' do
action [:enable, :start]
end
file '/var/www/index.html' do
content '<html>
<body>
<h1>Hello world!!</h1>
</body>
</html>'
end
When I try to execute I obtain this error ...
[osboxes#osboxes chef-repo]$ sudo chef-apply hello.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* yum_package[apache2] action install
* No candidate version available for apache2
================================================================================
Error executing action `install` on resource 'yum_package[apache2]'
================================================================================
Chef::Exceptions::Package
-------------------------
No candidate version available for apache2
The same if I use a simpler recipe like this
package 'apache2'
My Chef client workstation installation is the following
[osboxes#osboxes chef-repo]$ chef --version
Chef Development Kit Version: 3.0.36
chef-client version: 14.1.12
delivery version: master (7206afaf4cf29a17d2144bb39c55b7212cfafcc7)
berks version: 7.0.2
kitchen version: 1.21.2
inspec version: 2.1.72
On CentOS / RHEL etc (and on Fedora) the package name for Apache is "httpd".
Alternatively, there is a standard cookbook for installing and configuring Apache2:
https://supermarket.chef.io/cookbooks/apache2
It is fairly sophisticated, and includes recipes for configuring a number of common Apache modules.

TensorFlow Serving Error

I have installed Tensorflow Serving as outlined on the install page at https://tensorflow.github.io/serving/setup. However, when I follow the build instruction on the page I get the following error:
$ bazel build tensorflow_serving/...
ERROR: /home/**PATH**/external/org_tensorflow/third_party/py/python_configure.bzl:183:20: unexpected keyword 'environ' in call to repository_rule(implementation: function, *, attrs: dict or NoneType = None, local: bool = False).
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Extension file 'third_party/py/python_configure.bzl' has errors.
INFO: Elapsed time: 0.623s
I am running on Ubuntu and TensorFlow 1.0.1 build. I am using Python 2.7 and have set up a virtualenv.
I can successfully build the bazel hello example and also am able to complete the gRPC quick start found at http://www.grpc.io/docs/quickstart/python.html.
Any suggestions?
-Dave
The trouble was an old copy of bazel. To determine your version
$ bazel version
Build label: 0.4.5
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Mar 16 12:19:38 2017 (1489666778)
Build timestamp: 1489666778
Build timestamp as int: 1489666778
In my case it required a manual removal of the old version
rm -fr ~/.bazel ~/.bazelrc
Next, I chose the install using the installer for ubuntu.
$ ./bazel-0.4.5-installer-linux-x86_64.sh
Bazel installer
---------------
Bazel is bundled with software licensed under the GPLv2 with Classpath exception.
You can find the sources next to the installer on our release page:
https://github.com/bazelbuild/bazel/releases
# Release 0.4.5 (2017-03-16)
There was still another trick to getting it to work.
$cd ..
$ bazel test tensorflow_serving/...
Python Configuration Error: 'PYTHON_BIN_PATH' environment variable is not set
This error is also related to versioning, but in this case it was an issue with serving. The solution was to revert to an earlier version and update the submodule from git (I had previously cloned the repository). From the serving directory:
$ git checkout 0.5.1
M tensorflow
M tf_models
Note: checking out '0.5.1'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 51bb356... Merge pull request #325 from kirilg/0.5.1
(tensorflow) $ git submodule update
Submodule path 'tensorflow': checked out '07bb8ea2379bd459832b23951fb20ec47f3fdbd4'
Submodule path 'tf_models': checked out '2fd3dcf3f31707820126a4d9ce595e6a1547385d'
(tensorflow) $ bazel test tensorflow_serving/...
Serving now reports success:
INFO: Found 199 targets and 57 test targets...
[1,299 / 4,037] Still waiting for 200 jobs to complete:
Running (standalone):

Build failing on Travis CI for simple Spring MVC app

I have created a simple Spring MVC app and built and deployed using apache tomcat 7 on my localhost. The build for the same app is failing on Travis CI and the build log reads :
$ git clone --depth=50 --branch=master git://github.com/swarup-donepudi/BidToBuy.git swarup-donepudi/BidToBuy
Cloning into 'swarup-donepudi/BidToBuy'...
remote: Counting objects: 32, done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 32 (delta 7), reused 28 (delta 3), pack-reused 0
Receiving objects: 100% (32/32), 5.35 KiB | 0 bytes/s, done.
Resolving deltas: 100% (7/7), done.
Checking connectivity... done.
$ cd swarup-donepudi/BidToBuy
$ git checkout -qf 4faeebe46b78137ea5676f49e2bf5224a8ffcb90
This job is running on container-based infrastructure, which does not allow use of 'sudo', setuid and setguid executables.
If you require sudo, add 'sudo: required' to your .travis.yml
See http://docs.travis-ci.com/user/workers/container-based-infrastructure/ for details.
$ java -version
java version "1.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)
$ javac -version
javac 1.7.0_76
0.92s$ ant deps
Buildfile: /home/travis/build/swarup-donepudi/BidToBuy/build.xml
BUILD FAILED
/home/travis/build/swarup-donepudi/BidToBuy/build.xml:87: /home/travis/build/swarup-donepudi/BidToBuy/C:/tomcat/lib does not exist.
Total time: 0 seconds
The command "ant deps" failed and exited with 1 during .
Your build has been stopped.
The build.properties file :
# Ant properties for building the springapp
appserver.home=C:/tomcat
# for Tomcat 5 use $appserver.home}/server/lib
# for Tomcat 6 use $appserver.home}/lib
appserver.lib=C:/tomcat/lib
deploy.path=C:/tomcat/webapps
tomcat.manager.url=http://localhost:8091/manager/text
tomcat.manager.username=tomcat
tomcat.manager.password=s3cret
Contents of .travis.yml file:
language: java
sudo: false
install: ant deps
I am assuming that the possible reason could be the path of the tomcat lib folder.
How does travis ci handle builds configured for tomcat server? I tried to find the answer but only to find none. Please help
I guess that the path you have given is not valid for the Travis CI environment:
/home/travis/build/swarup-donepudi/BidToBuy/C:/tomcat/lib does not exist
As you are stating this in your properties file:
C:/tomcat
Take into account that Travis CI runs the build within a Linux Container, so you will have to explore other ways to deploy your application.
As you are using Spring, perhaps you should try Spring Boot, as it comes with an embedded Tomcat server, therefore freeing you from the build script.