Re: error running python script in openshift

2018-05-30 Thread Graham Dumpleton
Also check out:

https://github.com/sclorg/s2i-python-container/tree/master/3.6 


which describes more about the Python S2I image in particular. You can see the 
code there for it as well.

Graham

> On 31 May 2018, at 8:06 am, Graham Dumpleton  wrote:
> 
> If you want to supply your own way of starting up your application when using 
> Python S2I, supply an executable 'app.sh' file.  This should be a shell 
> script which runs your application. Ensure that the final application is run 
> using 'exec'. Eg.
> 
> #!/bin/bash
> 
> exec python my-custom-app.py
> 
> Again point you to:
> 
> https://www.openshift.com/deploying-to-openshift/ 
> 
> 
> to understand how S2I works.
> 
> Graham
> 
>> On 31 May 2018, at 3:55 am, Brian Keyes > > wrote:
>> 
>> ok I found in the console an area to add environmental variables , but what 
>> is the value for "APP_FILE"? is it the name of the executable file i the git 
>> hub repo as in https://github.com/fusor/s2i-apb/blob/master/s2i/bin/run 
>> 
>> 
>> so the value should be 
>> "run"
>> 
>> On Wed, May 30, 2018 at 3:27 PM, Brian Keyes > > wrote:
>> I am attempting to get just one of the repos to run so I can attempt to 
>> reverse engineer it to work with what I have .
>> 
>> but how would I resolve this error 
>> 
>> 
>> 
>> 
>> ERROR: don't know how to run your application.
>> Please set either APP_MODULE, APP_FILE or APP_SCRIPT environment variables, 
>> or create a file 'app.py' to launch your application.
>> 
>> I have been using the meathod of just renaming my exe to app.py up till now 
>> but I want to investigate how to do this another way 
>> 
>> were exactly do I set the variables here and what do I set them to ?
>> 
>> this is the git hub repo I am working with 
>> 
>> 
>> 
>> https://github.com/fusor/s2i-apb.git 
>> 
>> thanks !!
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> --
>> Brian Keyes
>> Systems Engineer, Vizuri
>> 703-855-9074(Mobile)
>> 703-464-7030 x8239 (Office)
>> 
>> FOR OFFICIAL USE ONLY: This email and any attachments may contain 
>> information that is privacy and business sensitive.  Inappropriate or 
>> unauthorized disclosure of business and privacy sensitive information may 
>> result in civil and/or criminal penalties as detailed in as amended Privacy 
>> Act of 1974 and DoD 5400.11-R.
>> 
>> 
>> 
>> 
>> -- 
>> Brian Keyes
>> Systems Engineer, Vizuri
>> 703-855-9074(Mobile)
>> 703-464-7030 x8239 (Office)
>> 
>> FOR OFFICIAL USE ONLY: This email and any attachments may contain 
>> information that is privacy and business sensitive.  Inappropriate or 
>> unauthorized disclosure of business and privacy sensitive information may 
>> result in civil and/or criminal penalties as detailed in as amended Privacy 
>> Act of 1974 and DoD 5400.11-R.
>> 
>> ___
>> users mailing list
>> users@lists.openshift.redhat.com 
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users 
>> 

___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


Re: how to execute a script with S2i in openshift?

2018-05-30 Thread Graham Dumpleton
Sorry, obviously meant to credit Frédéric.

> On 31 May 2018, at 8:00 am, Graham Dumpleton  wrote:
> 
> As Brian says, use a custom assemble script that calls the original.
> 
> For a description of customising the S2I build process, check out the free 
> eBook for OpenShift at:
> 
> https://www.openshift.com/deploying-to-openshift/ 
> 
> 
> Chapter 9 covers this and more.
> 
> Graham
> 
>> On 31 May 2018, at 12:09 am, Frederic Giloux > > wrote:
>> 
>> Hi Brian
>> 
>> If you want your script to be executed by new builds it should be named 
>> assemble. It can then call the original assemble script, that you may have 
>> renamed, a python programm or any other thing you need. The run script is 
>> called when the final container is launched not during the build.
>> 
>> Regards,
>> 
>> Frédéric 
>> 
>> On Wed, 30 May 2018, 17:51 Brian Keyes, > > wrote:
>> I have an python script in my git hub repo
>> 
>> I want to run that script when I run "oc new-build"
>> 
>> Do I simply place the script in the git hub under   .s2i/bin/run  ?
>> 
>> is there anything else I have to do
>> 
>> thanks
>> 
>> ___
>> users mailing list
>> users@lists.openshift.redhat.com 
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users 
>> 
>> ___
>> users mailing list
>> users@lists.openshift.redhat.com 
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
> 

___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


Re: error running python script in openshift

2018-05-30 Thread Graham Dumpleton
If you want to supply your own way of starting up your application when using 
Python S2I, supply an executable 'app.sh' file.  This should be a shell script 
which runs your application. Ensure that the final application is run using 
'exec'. Eg.

#!/bin/bash

exec python my-custom-app.py

Again point you to:

https://www.openshift.com/deploying-to-openshift/ 


to understand how S2I works.

Graham

> On 31 May 2018, at 3:55 am, Brian Keyes  wrote:
> 
> ok I found in the console an area to add environmental variables , but what 
> is the value for "APP_FILE"? is it the name of the executable file i the git 
> hub repo as in https://github.com/fusor/s2i-apb/blob/master/s2i/bin/run 
> 
> 
> so the value should be 
> "run"
> 
> On Wed, May 30, 2018 at 3:27 PM, Brian Keyes  > wrote:
> I am attempting to get just one of the repos to run so I can attempt to 
> reverse engineer it to work with what I have .
> 
> but how would I resolve this error 
> 
> 
> 
> 
> ERROR: don't know how to run your application.
> Please set either APP_MODULE, APP_FILE or APP_SCRIPT environment variables, 
> or create a file 'app.py' to launch your application.
> 
> I have been using the meathod of just renaming my exe to app.py up till now 
> but I want to investigate how to do this another way 
> 
> were exactly do I set the variables here and what do I set them to ?
> 
> this is the git hub repo I am working with 
> 
> 
> 
> https://github.com/fusor/s2i-apb.git 
> 
> thanks !!
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> Brian Keyes
> Systems Engineer, Vizuri
> 703-855-9074(Mobile)
> 703-464-7030 x8239 (Office)
> 
> FOR OFFICIAL USE ONLY: This email and any attachments may contain information 
> that is privacy and business sensitive.  Inappropriate or unauthorized 
> disclosure of business and privacy sensitive information may result in civil 
> and/or criminal penalties as detailed in as amended Privacy Act of 1974 and 
> DoD 5400.11-R.
> 
> 
> 
> 
> -- 
> Brian Keyes
> Systems Engineer, Vizuri
> 703-855-9074(Mobile)
> 703-464-7030 x8239 (Office)
> 
> FOR OFFICIAL USE ONLY: This email and any attachments may contain information 
> that is privacy and business sensitive.  Inappropriate or unauthorized 
> disclosure of business and privacy sensitive information may result in civil 
> and/or criminal penalties as detailed in as amended Privacy Act of 1974 and 
> DoD 5400.11-R.
> 
> ___
> users mailing list
> users@lists.openshift.redhat.com 
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users 
> 
___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


Re: how to execute a script with S2i in openshift?

2018-05-30 Thread Graham Dumpleton
As Brian says, use a custom assemble script that calls the original.

For a description of customising the S2I build process, check out the free 
eBook for OpenShift at:

https://www.openshift.com/deploying-to-openshift/ 


Chapter 9 covers this and more.

Graham

> On 31 May 2018, at 12:09 am, Frederic Giloux  wrote:
> 
> Hi Brian
> 
> If you want your script to be executed by new builds it should be named 
> assemble. It can then call the original assemble script, that you may have 
> renamed, a python programm or any other thing you need. The run script is 
> called when the final container is launched not during the build.
> 
> Regards,
> 
> Frédéric 
> 
> On Wed, 30 May 2018, 17:51 Brian Keyes,  > wrote:
> I have an python script in my git hub repo
> 
> I want to run that script when I run "oc new-build"
> 
> Do I simply place the script in the git hub under   .s2i/bin/run  ?
> 
> is there anything else I have to do
> 
> thanks
> 
> ___
> users mailing list
> users@lists.openshift.redhat.com 
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users 
> 
> ___
> users mailing list
> users@lists.openshift.redhat.com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users

___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


Re: how to execute a script with S2i in openshift?

2018-05-30 Thread Brian Keyes
Ok what I will do is rename the app.py to run and change the path in git
hub to be  s2i/bin/run.


I am not sure I understand what you mean by

"Use exec for the call"


thanks again !!


On Wed, May 30, 2018 at 12:26 PM, Frederic Giloux 
wrote:

> Hi Brian
>
> A file called run is expected not a directory.
> You may have a simple shell script named run that calls your programm. Use
> exec for the call.
>
> Regards,
>
> Frédéric
>
> On Wed, 30 May 2018, 18:19 Brian Keyes,  wrote:
>
>> thanks for the quick reply ,
>>
>> What my goal is to have my script run when the final container in
>> launched , right now I have this in the  git hub repo under
>> s2i/bin/run/app.py
>>
>> I get this error when I attempt to run this in openshift portal
>>
>>
>> /usr/bin/container-entrypoint: line 2: /tmp/scripts/run: Is a directory
>>
>>
>>
>> /usr/bin/container-entrypoint: line 2: exec: /tmp/scripts/run: cannot
>> execute: Is a directory
>>
>>
>> I am thinking that the paths here are in the container right?
>>
>> thanks again
>>
>>
>> On Wed, May 30, 2018 at 12:09 PM, Frederic Giloux 
>> wrote:
>>
>>> Hi Brian
>>>
>>> If you want your script to be executed by new builds it should be named
>>> assemble. It can then call the original assemble script, that you may have
>>> renamed, a python programm or any other thing you need. The run script is
>>> called when the final container is launched not during the build.
>>>
>>> Regards,
>>>
>>> Frédéric
>>>
>>> On Wed, 30 May 2018, 17:51 Brian Keyes,  wrote:
>>>
 I have an python script in my git hub repo

 I want to run that script when I run "oc new-build"

 Do I simply place the script in the git hub under   .s2i/bin/run  ?

 is there anything else I have to do

 thanks

 ___
 users mailing list
 users@lists.openshift.redhat.com
 http://lists.openshift.redhat.com/openshiftmm/listinfo/users

>>>
>>
>>
>> --
>> Brian Keyes
>> Systems Engineer, Vizuri
>> 703-855-9074(Mobile)
>> 703-464-7030 x8239 (Office)
>>
>> FOR OFFICIAL USE ONLY: This email and any attachments may contain
>> information that is privacy and business sensitive.  Inappropriate or
>> unauthorized disclosure of business and privacy sensitive information may
>> result in civil and/or criminal penalties as detailed in as amended Privacy
>> Act of 1974 and DoD 5400.11-R.
>>
>>


-- 
Brian Keyes
Systems Engineer, Vizuri
703-855-9074(Mobile)
703-464-7030 x8239 (Office)

FOR OFFICIAL USE ONLY: This email and any attachments may contain
information that is privacy and business sensitive.  Inappropriate or
unauthorized disclosure of business and privacy sensitive information may
result in civil and/or criminal penalties as detailed in as amended Privacy
Act of 1974 and DoD 5400.11-R.
___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


Re: how to execute a script with S2i in openshift?

2018-05-30 Thread Brian Keyes
thanks for the quick reply ,

What my goal is to have my script run when the final container in launched
, right now I have this in the  git hub repo under s2i/bin/run/app.py

I get this error when I attempt to run this in openshift portal


/usr/bin/container-entrypoint: line 2: /tmp/scripts/run: Is a directory



/usr/bin/container-entrypoint: line 2: exec: /tmp/scripts/run: cannot
execute: Is a directory


I am thinking that the paths here are in the container right?

thanks again


On Wed, May 30, 2018 at 12:09 PM, Frederic Giloux 
wrote:

> Hi Brian
>
> If you want your script to be executed by new builds it should be named
> assemble. It can then call the original assemble script, that you may have
> renamed, a python programm or any other thing you need. The run script is
> called when the final container is launched not during the build.
>
> Regards,
>
> Frédéric
>
> On Wed, 30 May 2018, 17:51 Brian Keyes,  wrote:
>
>> I have an python script in my git hub repo
>>
>> I want to run that script when I run "oc new-build"
>>
>> Do I simply place the script in the git hub under   .s2i/bin/run  ?
>>
>> is there anything else I have to do
>>
>> thanks
>>
>> ___
>> users mailing list
>> users@lists.openshift.redhat.com
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>
>


-- 
Brian Keyes
Systems Engineer, Vizuri
703-855-9074(Mobile)
703-464-7030 x8239 (Office)

FOR OFFICIAL USE ONLY: This email and any attachments may contain
information that is privacy and business sensitive.  Inappropriate or
unauthorized disclosure of business and privacy sensitive information may
result in civil and/or criminal penalties as detailed in as amended Privacy
Act of 1974 and DoD 5400.11-R.
___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


Re: how to execute a script with S2i in openshift?

2018-05-30 Thread Frederic Giloux
Hi Brian

If you want your script to be executed by new builds it should be named
assemble. It can then call the original assemble script, that you may have
renamed, a python programm or any other thing you need. The run script is
called when the final container is launched not during the build.

Regards,

Frédéric

On Wed, 30 May 2018, 17:51 Brian Keyes,  wrote:

> I have an python script in my git hub repo
>
> I want to run that script when I run "oc new-build"
>
> Do I simply place the script in the git hub under   .s2i/bin/run  ?
>
> is there anything else I have to do
>
> thanks
>
> ___
> users mailing list
> users@lists.openshift.redhat.com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>
___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


how to execute a script with S2i in openshift?

2018-05-30 Thread Brian Keyes
I have an python script in my git hub repo

I want to run that script when I run "oc new-build"

Do I simply place the script in the git hub under   .s2i/bin/run  ?

is there anything else I have to do

thanks
___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


[logging]

2018-05-30 Thread Himmat Singh
Hi Team,

I have deployed rabbitmq, logstash server on openshift to make another ELK
pipeline for logging which supports some set of application and want to
forward logs from those application logs through ELK pipeline but
Elasticsearch will be the common For both EFK/ELK pipeline.

I have below secrets on openshift logging-elasticsearch :

logging-elasticsearch created 3 months ago
Opaque Reveal Secret
admin-ca
*
admin-cert
*
admin-key
*
admin.jks
*
key
*
searchguard.key
*
searchguard.truststore
*
truststore
*

--

I have grabbed truststore key using below command and used
truststore_password => tspass from elasticsaerch.yml :

sudo oc get secret logging-elasticsearch --template='{{index .data
"truststore"}}' | base64 -d > truststore.jks

Please help me with procedure i need to follow if i want to connect using
truststore keys,username,password for truststore.

Below is logstash.conf file : :

input {
  rabbitmq {
host => "rabbitmq-logstash"
queue => "logstash"
durable => true
port => 5672
user => "admin"
password => "admin"
}
}
output {
  elasticsearch {
hosts => ["logging-es:9200"]
#cacert => '/etc/logstash/conf.d/keys/es-ca.crt'
#user => 'fluentd'
#password => 'changeme'
ssl => true
ssl_certificate_verification => false
truststore => "/etc/logstash/conf.d/keys/truststore.jks"
truststore_password => tspass
index => "logstash-%{+.MM.dd}"
manage_template => false
document_type => "%{[@metadata][type]}"
   }
  stdout { codec => rubydebug }
}

I am facing below error:

10:51:56.154 [Ruby-0-Thread-5:
/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.2-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:228]
WARN logstash.outputs.elasticsearch - Attempted to resurrect connection to
dead ES instance, but got an error. {:url=>"https://logging-es:9200/;,
:error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError,
:error=>"Got response code '401' contacting Elasticsearch at URL '
https://logging-es:9200/'"}
10:52:01.155 [Ruby-0-Thread-5:
/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.2-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:228]
INFO logstash.outputs.elasticsearch - Running health check to see if an
Elasticsearch connection is working {:healthcheck_url=>
https://logging-es:9200/, :path=>"/"}
  | 10:52:01.158 [Ruby-0-Thread-5:
/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.2-java/lib/logstash/outputs/elasticsearch/http_client/pool.rb:228]
WARN logstash.outputs.elasticsearch - Attempted to resurrect connection to
dead ES instance, but got an error. {:url=>"https://logging-es:9200/;,
:error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError,
:error=>"Got response code '401' contacting Elasticsearch at URL '
https://logging-es:9200/'"}

Please help me with correct configuration how do i get all parameter
username, password and truststore_password, truststore, ca certificate.



*Thanks and Regards,  *
*Himmat Singh.*
*Virtusa|Polaris Pvt Ltd*
*8465009408*
___
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users