vcap | Cloud Foundry - the open platform as a service project | Microservice library

 by   cloudfoundry-attic Ruby Version: scotty_09012012 License: Apache-2.0

kandi X-RAY | vcap Summary

kandi X-RAY | vcap Summary

vcap is a Ruby library typically used in Architecture, Microservice, Cloud-foundry applications. vcap has a Permissive License and it has medium support. However vcap has 1 bugs and it has 3 vulnerabilities. You can download it from GitHub.

Cloud Foundry is an open platform-as-a-service (PaaS). The system supports multiple frameworks, multiple application infrastructure services and deployment to multiple clouds.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              vcap has a medium active ecosystem.
              It has 1326 star(s) with 359 fork(s). There are 94 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              vcap has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of vcap is scotty_09012012

            kandi-Quality Quality

              vcap has 1 bugs (0 blocker, 0 critical, 1 major, 0 minor) and 22 code smells.

            kandi-Security Security

              vcap has 3 vulnerability issues reported (0 critical, 0 high, 3 medium, 0 low).
              vcap code analysis shows 0 unresolved vulnerabilities.
              There are 2 security hotspots that need review.

            kandi-License License

              vcap is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              vcap releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.
              vcap saves you 2741 person hours of effort in developing the same functionality from scratch.
              It has 5938 lines of code, 89 functions and 263 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vcap
            Get all kandi verified functions for this library.

            vcap Key Features

            No Key Features are available at this moment for vcap.

            vcap Examples and Code Snippets

            No Code Snippets are available at this moment for vcap.

            Community Discussions

            QUESTION

            New Relic: Script always returns Status 400 but works in Postman
            Asked 2021-May-07 at 06:03

            I'm trying to make a healthcheck for my service in New Relic. So I just want to call one of my APIs every x minutes and see if it returns 200. In New Relic I created a new synthetic monitor and now I'm trying to write a script for that monitor.

            The script is supposed to make a post request to our service and receive a token in the response with status 200. In Postman this post request works and returns the token + Status 200 (I replaced the sensitive strings with <...>):

            ...

            ANSWER

            Answered 2021-May-07 at 06:03

            I had to replace 'body' with 'form' like in this example.

            I aslo added now the call to the API after the token was received. The final script was:

            Source https://stackoverflow.com/questions/67416339

            QUESTION

            how to run a one-off task on cloudfoundry to upload data before starting Python app
            Asked 2021-Apr-05 at 16:10

            Hi this is my first experience trying to deploy a Python app on cloud using CF. I am having issues deploying my app; I sincerely appreciate if anyone can help me or point me to the right direction to solve the issue.

            The main problem is the app that I am trying to deploy is large size due to a lot of python dependencies. The size of my app directory is 200 Kb. The first error I observed was: Staging fails due to "Failed to upload payload for droplet" . I think the reason is when all Python dependencies are downloaded from requirements.txt file and finally the droplet is created its size is too large for upload. The droplet size=982. 3 Mb.

            The first solution I tried was vendoring app where I created a vendor directory containing all python dependencies but the size of vendor directory was greater that 1Gb, which causes the upload size exceed 1Gb limit and leads to failure in uploading app files.

            The second solution I am working on is to upload all installed Python libraries on an object store (in my case S3 bucket which is bounded to my app) and then download the dependencies folder called Pypackages to the app's root directory: /home/vcap/app, so I want to have /home/vcap/app/Pypackages exist before my app starts on the cloud. But I couldn't do it successfully yet. I have included a python script in my app directory which downloads files from S3 bucket successfully. (I have put the correct absolute path for download in downloadS3.py script ie, /home/vcap/app/Pypackages) I want to run this script using "python downloadS3.py" as a one-off task. First I tried the solution here : Can I have multiple commands run in a manifest.yml file? and although I can see the status of the task is SUCCEED via '$cf tasks my-app-name' , /home/vcap/app/Pypackages does not exist.

            I also tried to run one-off task as the steps below:

            1- $ cf push -c 'python downloadS3.py && sleep infinity' -i 1 --no-route

            2- $ cf push -c 'null' I have printed the contents of /home/vcap/app on my app, ie when app is started and I enter the url in my browser (I don't know what is the right way to see the contents of root directory). Anyway, the problem is Pypackages are not downloaded to the correct root directory. I am not sure if I am running the one-off task in a wrong way or if there is a better solution to make my app work. I appreciate any helps! (edited)

            ...

            ANSWER

            Answered 2021-Apr-05 at 16:10

            Diego Cells stage apps and upload droplet to blobstore via cloud controller, the max file can be uploaded is configurable at Ops Manager > TAS for VMs > Application Developer Control > Maximum File Upload Size (MB), default is 1024MB. Seems this is causing restriction, if you can get it increased with your admin help...

            Tasks run in their own containers so possibly not an option. I think Python buildpack collects and install the packages before creating the droplet, so don't think copying packages directly to /app directory will be of much help.

            If you have data files then you can use .profile file and do some scripting to copy them from S3 or server/NFS location into the /app directory. Something like

            Source https://stackoverflow.com/questions/66954725

            QUESTION

            Why is my pre-built cloud foundry node app trying to fetch modules that are already in node_modules?
            Asked 2021-Mar-18 at 21:49

            I have a pre-built node app that must not attempt to access the network if npm install is run prior to startup - the intent is for everything to already be present in the node_modules directory. It is being deployed in a cloud foundry environment.

            This is not a proxy problem - there must be no attempt to access registry url's during cloud foundry app staging. I'm looking for ideas why it's trying to do this.

            When this app is deployed to cloud foundry, even though it detects the presence of the node_modules directory during staging, it still tries to retrieve basic dependency modules (like @node/types) that are already present in node_modules, and of course it times out trying to reach a registry that is not permitted in these environments. There are hundreds of other dependencies that it does not attempt to retrieve, but for some reason it thinks it does need some modules. For example:

            ...

            ANSWER

            Answered 2021-Mar-18 at 12:56

            Not 100% sure this will resolve the issue, but here's what I've seen commonly trip people up trying to vendor Node.js dependencies:

            First, review the instructions from the docs: https://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring

            1. Run npm install (you've done this)
            2. Make sure you have a package-lock.json file (you probably have this). That locks in the versions to use and should guarantee what's in node_modules/ matches what will be installed. If you don't have this, you'll see Warning: package-lock.json not found. output from the buildpack.
            3. Make sure you're pushing up package.json, package-lock.json, and the full node_modules/ directory, along with all your application code.

            These are not documented, but some tips from what I've observed working with others on this:

            1. Make sure you don't have a .cfignore file, as that could accidentally cause node_modules/ to not be pushed. You can typically tell if node_modules/ is not being pushed because the number of files & size of what is being pushed will be much, much larger with this. You will also see the message It is recommended to vendor the application's Node.js dependencies if the node_modules/ directory doesn't exist.

            2. When you run npm install locally, you need to be running it in an Ubuntu Bionic VM or container. This is because NPM will often install modules that require native code. It will automatically handle this, but what's in node_modules/ is specific for the OS & architecture where you run npm install. Thus If you run npm install on a non-Ubuntu Bionic OS (say Windows or MacOS), it will compile the native code for your local machine. When you push this up, it won't match and NPM will try to reinstall the package which can trigger access to the Internet.

            3. Make sure you're using the latest Node.js buildpack & Node.js version as possible. It always helps to have the latest code with bug fixes.

            4. NODE_ENV=production will be set by the buildpack, and this can sometimes cause difference in behavior. It also skips installing dev dependencies. Not likely the issue here, but worth mentioning as this trips up some people.

            Source https://stackoverflow.com/questions/66682939

            QUESTION

            Encrypted properties on Cloud foundry with Sping Boot
            Asked 2021-Mar-16 at 15:15

            I have a Spring Boot application which has some encrypted values in its property file e.g. spring.security.user.password=ENC(ZUkuSkFAiu/k7v7G1538ouQmuSWeAuOucAVuvxLCDwwJ0mgnIdfl3N/RgiZMGeBm) I am using jasypt to decrypt these on the fly. This works fine running locally.

            However when I deploy the app on Cloud Foundry my property file now pulls the value from vcap env variables. e.g. spring.security.user.password=${vcap.services.myconfig.credentials.user.password}

            in PCF the value is added as

            user.password = ENC(ZUkuSkFAiu/k7v7G1538ouQmuSWeAuOucAVuvxLCDwwJ0mgnIdfl3N/RgiZMGeBm)

            However now my app fails to start and i get an error saying

            ERROR 22 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'securityFilterChainRegistration' defined in class path resource [org/springframework/boot/autoconfigure/security/servlet/SecurityFilterAutoConfiguration.class]: Unsatisfied dependency expressed through method 'securityFilterChainRegistration' parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.security-org.springframework.boot.autoconfigure.security.SecurityProperties': Could not bind properties to 'SecurityProperties' : prefix=spring.security, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.security.user.password' to java.lang.String

            Is there any reason I am missing why this works locally but not on Cloud Foundry?

            UPDATE

            ...

            ANSWER

            Answered 2021-Mar-14 at 14:02

            QUESTION

            Running python IBM Cloud Apps Cloud Foundry with error in ModuleNotFoundError: No module named 'matplotlib'
            Asked 2021-Mar-13 at 14:09

            After deployment in IBM Cloud - App Cloud Foundry using Python - Django I found the follow error running the container:

            ...

            ANSWER

            Answered 2021-Mar-13 at 14:09

            Your Dockerfile is for running the app as container. With Cloud Foundry you need to really have a requirements.txt with all the modules your app depends on. You also need a runtime.txt to specify the Python version. Check out this Cloud Foundry documentation on the Python buildpack and the required configuration files.

            Source https://stackoverflow.com/questions/66614353

            QUESTION

            I can't deploy a working rails 6 app on cloud foundry due to bundle version
            Asked 2021-Feb-28 at 18:59

            I am experiencing this issue even having a higher version of bundler in my gemfile. What could be the issue causing this?

            ...

            ANSWER

            Answered 2021-Feb-28 at 18:59

            The Ruby buildpack cannot carry every single version of Ruby & bundler, it would make for an extremely large buildpack. Due to this, all buildpacks will only retain a select set of versions of the software they include in each version of the buildpack. Buildpacks are meant to encourage you to keep up with the latest versions of your software, so buildpacks will drop older versions of software as the buildpacks are updated & new releases are cut.

            This means you have three choices:

            1. You can look at the release notes for your buildpack or the build pack dependency viewer to see buildpack versions contain the specific versions of software you require.

              For example, if you must have bundler 2.1.4, then you'd need to look and find the latest buildpack version which contains it. Hint, it's v1.8.27. You can confirm the same info using the buildpack release notes also.

              Once you find the specific buildpack version, then you need to tell Cloud Foundry that you want that version of the buildpack, which contains the version of the software you require. For example: cf push -b https://github.com/cloudfoundry/ruby-buildpack#v1.8.27.

              This has some drawbacks though, a.) Cloud Foundry must be able to talk to the Internet and download that buildpack and b.) you're stuck with the versions of software in that buildpack, so your app may be vulnerable to security issues that have already been resolved in newer versions of software installed by the buildpack.

            2. Most of the time you don't care about the exact specific version of Ruby, Bundler, or other libraries, and what you want is to declare a more flexible version in your project, like "I want Bundler 2". At which point, you'll just get the latest Bundler 2.x.y version supported, so long as the buildpack you're using still includes some version of Bundler 2 (even major versions will roll-off over time).

            3. If you feel like you do need to continue specifying an exact version of Bundler (or other software), you will need to periodically update your application and the versions of software it uses to work with the more recent versions installed by the buildpack.

              For example, the latest Ruby buildpack as I write this, 1.8.32, includes Bundler 2.2.11. That would mean you'd need to update your app to expect and work with this version.

            In general, the most friction-free & safe option is #2. You'll continue to get updates to your software and it should continue to deploy without issue. The downside is that you may over time get an update that's incompatible with your app. You'd then have to fix that before you can continue deploying your app.

            Option #3 is also OK, but it requires a lot of micromanagement. If you don't really need that level of control, I would suggest going with option #2. You'll get similar results and it'll be less effort.

            Option #1 should be a last resort and only used if your app absolutely has no other option, or perhaps you need to buy some time as you upgrade the app to be compatible with newer versions. This version, over time, will leave your app susceptible to security vulnerabilities.

            You might be thinking that this all sounds like a tremendous pain, but it's not. It's the buildpack forcing you to think about your software dependencies and forcing good upgrade hygiene. That is a very good thing, as it will keep your software up-to-date and keep your application protected from vulnerabilities in the software it consumes.

            Source https://stackoverflow.com/questions/66403420

            QUESTION

            Package cv2 crashes after a while
            Asked 2021-Jan-15 at 19:37

            I've a webcam filming my water meter and a Python script on a raspberry is converting this picture in several steps so that i could read out the consumption.

            Now my problem. After a while (sometimes it runs for weeks, sometimes after some hours and today sometimes after minutes) I'm getting this error:

            ...

            ANSWER

            Answered 2021-Jan-15 at 19:37

            I think the first thing that you should do is to check the ret. From this tutorial:

            cap.read() returns a bool (True/False). If the frame is read correctly, it will be True

            If it is False you have several alternatives: continue the while loop, sleep for some time, terminate the program, release the video capture and create it again, etc. You can also combine them.

            Example to release the video capture and create it again:

            Source https://stackoverflow.com/questions/65740655

            QUESTION

            Issue When Running Django Migrations on MariaDB 10.5.8
            Asked 2021-Jan-13 at 13:44

            I have been trying to migrate from a mysql database (version 5.7.26-29-31.37-log - output from SELECT VERSION()) to a mariadb (version 10.5.8-MariaDB-log - output from SELECT VERSION())

            Also, I saw and updated django from version 2.2 to version 3.1.5, as mariadb is officially supported from version 3.0. With this, I also updated the mysqlclient library to 2.0.3.

            But when on the server the "migrate" command is run, it fails with this error when doing it with the new DB: decimal.InvalidOperation: []

            Here is the stack-trace:

            ...

            ANSWER

            Answered 2021-Jan-13 at 13:44

            In the end, to exchange the driver / db connector worked for me:

            1. Remove the mysqlclient from the dependencies

            2. Add mysql-connector-python~=8.0 to the dependencies (insert into requirements.txt)

            3. Adapt your DATABASES config like this in the settings.py file

            Source https://stackoverflow.com/questions/65592745

            QUESTION

            Python with --enable-shared on cloudfoundry
            Asked 2020-Dec-18 at 10:11

            I would like to deploy an application on a cloudfoundry instance, consisting of an Rmarkdown file which should contain both R and python chunks. I'd like to render the document on cloudfoundry, rather than doing so locally and just pushing up the HTML file.

            For knitr to work with python, it uses the reticulate package which states in the docs:

            Note that for reticulate to bind to a version of Python it must be compiled with shared library support (i.e. with the --enable-shared flag).

            I tried to use the cloudfoundry python buildpack to provide python for reticulate, but got the error Python shared library not found, Python bindings not loaded, and reticulate::py_discover_config() on the cloudfoundry app gives:

            ...

            ANSWER

            Answered 2020-Dec-18 at 10:11

            I have found that I can install a version of python that reticulate is happy to work with, using reticulate itself. Ahead of rendering the Rmarkdown document, I can use:

            Source https://stackoverflow.com/questions/65328763

            QUESTION

            When using KV in logstash, I am getting my key with escaped character, how do i read this value in the Ruby?
            Asked 2020-Oct-13 at 12:30

            I have data coming from Kafka, and the data will look like this:

            ...

            ANSWER

            Answered 2020-Oct-13 at 07:42

            Don't know anything about Kafka but what your screenshoys shows is in Ruby a Hash (map) although only the keys are visible on the image. In Ruby, if the name of the Hash is event (I'm guessing here) then you can get to the value of the x-vcap-request-id key like this event["x-vcap-request-id"]

            I use a string as key because your screeenshot suggests it is but in Ruby keys are most of the time Symbols (a kind of unique fixed string) so it could also be event[:x-vcap-request-id]

            Source https://stackoverflow.com/questions/64330310

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            Unspecified vulnerability in StoresAndCalendarsList.cgi in Paul Smith Computer Services vCAP 1.9.0 Beta and earlier allows remote attackers to cause a denial of service via the session parameter, possibly related to format string specifiers or malformed URL encoding.
            Multiple cross-site scripting (XSS) vulnerabilities in Paul Smith Computer Services vCAP 1.7.0 allow remote attackers to inject arbitrary web script or HTML via (1) the statusmsg parameter in RegisterPage.cgi or (2) a URI corresponding to a nonexistent file. NOTE: the provenance of this information is unknown; the details are obtained from third party information.

            Install vcap

            Cloud Foundry is made up of a number of system components (cloud controller, health manager, dea, router, etc.). These components can run co-located in a single vm/single os or can be spread across several machines/vm’s. For development purposes, the preferred environment is to run all of the core components within a single vm and then interact with the system from outside of the vm via an ssh tunnel. The pre-defined domain *.vcap.me maps to local host, so when you use this setup, the end result is that your development environment is available at [http://api.vcap.me](http://api.vcap.me). For large scale or multi-vm deployments, the system is flexible enough to allow you to place system components on multiple vm’s, run multiple nodes of a given type (e.g., 8 routers, 4 cloud controllers, etc.). The detailed install instructions below walk you through the install process for a single vm installation. Versions of these instructions have been used for production deployments, and for our own development purposes. many of us develop on mac laptops, so some additional instructions for this environment have been included.
            Once the system is installed, you can run the following Yeti cases(Yeti stands for "Yeti Extraordinary Test Infrastructure") to ensure that major functionality is working.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/cloudfoundry-attic/vcap.git

          • CLI

            gh repo clone cloudfoundry-attic/vcap

          • sshUrl

            git@github.com:cloudfoundry-attic/vcap.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link