Code Monkey home page Code Monkey logo

platforms's Introduction

platforms

Actions Status

Source for official Docker images of tsuru platforms.

All platforms are available in Docker Hub:

Installing platforms

In order to use one of the platforms provided here, you need to have tsuru-admin installed and run tsuru-admin platform-add:

% tsuru-admin platform-add <platform-name>

Prior to version 0.13.0, tsurud didn't accept prebuilt images in platform-add/platform-update, so in order to add a platform from this repository, you need to create a Dockerfile with a single line (FROM <image-name>).

Dockerfiles are provided in the basebuilder repository, so in order to add a platform, it's as simple as running tsuru-admin platform-add. For example, for the Java platform:

% tsuru-admin platform-add java -d https://raw.github.com/tsuru/basebuilder/master/java/Dockerfile

Replace "java" with any other platform and you're good to go!

Creating new platforms

tsuru requires only a single executable for platforms: /var/lib/tsuru/deploy. It also expects the deploy-agent to be installed. This script will receive two parameters: the deployment type (which is always "archive" in latest release) and the URL for the archive.

We provide a base image which platform developers can use to build upon: base-platform. This platform provides a base deployment script, which handles package downloading and extraction in proper path, along with operating system package management. For more details, check the README of base-platform.

platforms's People

Contributors

agentelinux avatar aitherios avatar andrestc avatar andrewsmedina avatar cezarsa avatar dependabot[bot] avatar dnsaoki2 avatar fsouza avatar gabrielgene avatar ggarnier avatar guilhermearaujo avatar guilhermebr avatar guilhermef avatar gwmoura avatar heynemann avatar lucasts avatar marcelometal avatar mdjunior avatar morpheu avatar nettoclaudio avatar pedrosnk avatar raphamorim avatar rwillrich avatar scorphus avatar vierno avatar wpjunior avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platforms's Issues

platform nodejs error parsing node version

Hi

I have a developer pushing a nodejs app and is getting error because the engines.node version is malformed

"engines": {
-    "node": ">= 8.6.0"

with the >= the deploy script returns error and exit

remote: error running "/var/lib/tsuru/deploy archive http://172.16.70.100:3232/?id=21eb855af295f8432dfc22f656786aa9415cf3e9d77278380806edf23f3e725d375f00f32e8e497e4fc51a31ade46b3730da8e6cbad1bd1f431802fb08cc1e0c": exit status 3
remote: Exit status 1

also, this is dificult to debug and would be nice to add verbose deploys #39

buildpack: can't build in tsuru-bootstrap

I'm trying to add buildpack platform in tsuru-bootstrap environment:
Download output was truncated for posting here on GH, that's why progress bar aren't shown properly

$ tsuru-admin platform-add buildpack -d https://github.com/tsuru/platforms/raw/master/buildpack/Dockerfile
Step 1 : FROM progrium/buildstep
Pulling from progrium/buildstep
Pulling fs layer
Pulling fs layer
Pulling fs layer
Pulling fs layer
Pulling fs layer
Pulling fs layer
Pulling fs layer
Pulling fs layer
Downloading [==================================================>]     32 B/32 B
Extracting [==================================================>]    337 B/337 B
Extracting [==================================================>]    337 B/337 B
Extracting [==================================================>]    337 B/337 B
Pull complete
Digest: sha256:70ecdcb8660431593f56b0615da75ef013a0fd58d24f388341e731840c87ce81
Status: Downloaded newer image for progrium/buildstep:latest
 ---> d6d2e6f5fe3c
Step 2 : RUN locale-gen en_US.UTF-8
 ---> Running in 9a7123f056a2
Generating locales...
  en_US.UTF-8... done
Generation complete.
 ---> 94ac1884869b
Removing intermediate container 9a7123f056a2
Step 3 : ENV LANG en_US.UTF-8 LANGUAGE en_US:en LC_ALL en_US.UTF-8 DEBIAN_FRONTEND noninteractive
 ---> Running in 5dc8dde08984
 ---> 7bba448a83ea
Removing intermediate container 5dc8dde08984
Step 4 : RUN apt-get update
 ---> Running in 5cc6c902bfeb
Ign http://archive.ubuntu.com trusty InRelease
Get:1 http://archive.ubuntu.com trusty-security InRelease [64.4 kB]
Get:2 http://archive.ubuntu.com trusty-updates InRelease [64.4 kB]
Hit http://archive.ubuntu.com trusty Release.gpg
Get:3 http://archive.ubuntu.com trusty-security/main amd64 Packages [476 kB]
Get:4 http://archive.ubuntu.com trusty-updates/main amd64 Packages [835 kB]
Hit http://archive.ubuntu.com trusty Release
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/universe amd64 Packages
Fetched 1,440 kB in 6s (216 kB/s)
Reading package lists...
 ---> cd3ddedf4d8a
Removing intermediate container 5cc6c902bfeb
Step 5 : RUN apt-get install curl sudo -y --force-yes
 ---> Running in 468e853e5144
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  libcurl3 libcurl4-openssl-dev
Suggested packages:
  libcurl4-doc libcurl3-dbg
The following NEW packages will be installed:
  sudo
The following packages will be upgraded:
  curl libcurl3 libcurl4-openssl-dev
3 upgraded, 1 newly installed, 0 to remove and 180 not upgraded.
Need to get 883 kB of archives.
After this operation, 1,544 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-security/main curl amd64 7.35.0-1ubuntu2.5 [123 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty-security/main libcurl4-openssl-dev amd64 7.35.0-1ubuntu2.5 [245 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty-security/main libcurl3 amd64 7.35.0-1ubuntu2.5 [173 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty-updates/main sudo amd64 1.8.9p5-1ubuntu1.2 [342 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 883 kB in 1s (791 kB/s)
(Reading database ... 48111 files and directories currently installed.)
Preparing to unpack .../curl_7.35.0-1ubuntu2.5_amd64.deb ...
Unpacking curl (7.35.0-1ubuntu2.5) over (7.35.0-1ubuntu2.3) ...
Preparing to unpack .../libcurl4-openssl-dev_7.35.0-1ubuntu2.5_amd64.deb ...
Unpacking libcurl4-openssl-dev:amd64 (7.35.0-1ubuntu2.5) over (7.35.0-1ubuntu2.3) ...
Preparing to unpack .../libcurl3_7.35.0-1ubuntu2.5_amd64.deb ...
Unpacking libcurl3:amd64 (7.35.0-1ubuntu2.5) over (7.35.0-1ubuntu2.3) ...
Selecting previously unselected package sudo.
Preparing to unpack .../sudo_1.8.9p5-1ubuntu1.2_amd64.deb ...
Unpacking sudo (1.8.9p5-1ubuntu1.2) ...
Setting up libcurl3:amd64 (7.35.0-1ubuntu2.5) ...
Setting up curl (7.35.0-1ubuntu2.5) ...
Setting up libcurl4-openssl-dev:amd64 (7.35.0-1ubuntu2.5) ...
Setting up sudo (1.8.9p5-1ubuntu1.2) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
 ---> 4fd754d7244e
Removing intermediate container 468e853e5144
Step 6 : RUN curl -sLo base-platform.tar.gz https://github.com/tsuru/base-platform/tarball/master
 ---> Running in fe49da41a57c
 ---> 9870d5a66f9b
Removing intermediate container fe49da41a57c
Step 7 : RUN mkdir -p /var/lib/tsuru/base
 ---> Running in e5445190da4c
 ---> 0348788a2693
Removing intermediate container e5445190da4c
Step 8 : RUN tar -xvf base-platform.tar.gz -C /var/lib/tsuru/base --strip 1
 ---> Running in 191b65822bcc
tsuru-base-platform-67e836c/AUTHORS
tsuru-base-platform-67e836c/CONTRIBUTORS
tsuru-base-platform-67e836c/Dockerfile
tsuru-base-platform-67e836c/LICENSE
tsuru-base-platform-67e836c/README.md
tsuru-base-platform-67e836c/deploy
tsuru-base-platform-67e836c/install
tsuru-base-platform-67e836c/rc/
tsuru-base-platform-67e836c/rc/config
tsuru-base-platform-67e836c/rc/os_dependencies
 ---> 97e0dead8baf
Removing intermediate container 191b65822bcc
Step 9 : RUN rm base-platform.tar.gz
 ---> Running in 331538de3a07
 ---> f1462f5c7782
Removing intermediate container 331538de3a07
Step 10 : RUN mkdir -p /var/lib/tsuru/buildpack
 ---> Running in 56222f608eb9
 ---> 45f7c905f1c5
Removing intermediate container 56222f608eb9
Step 11 : ADD . /var/lib/tsuru/buildpack
 ---> 3cff47dc7344
Removing intermediate container 38e2744e0c9e
Step 12 : RUN cp /var/lib/tsuru/buildpack/deploy /var/lib/tsuru
 ---> Running in aca2ccdf3569
cp: cannot stat ‘/var/lib/tsuru/buildpack/deploy’: No such file or directory
error in docker node "http://127.0.0.1:2375": The command '/bin/sh -c cp /var/lib/tsuru/buildpack/deploy /var/lib/tsuru' returned a non-zero code: 1
Error: Failed to add new platform.

Add support to verbose deploys

We could add an option to enable more verbose deploys, to help in debug. Usually when the deploy script breaks, it outputs something like exit status 1.

A possible solution would be check for the presence of a specific environment variable, like TSURU_DEPLOY_DEBUG, to increase the script output details.

Add Rust platform

  • Add basic platform support
  • Support code deployment
  • Support customized code deployment
  • Allow choosing Rust distribution: nightly, beta or stable
  • Support binary deployment
  • Add tests

clear_env not supported in PHP 5.5.9

Hi,

I developed a simple PHP project running on Nginx and PHP-FPM (fpm55), but Tsuru couldn't start the container. After investigating, I realized the system (Ubuntu 14.04 LTS) installed PHP 5.5.9, however PHP-FPM 5.5.9 doesn't support clear_env parameter (not until version 5.5.11) in pool.conf.

Do you think that clear_env parameter should be removed or at least commented so that a simple project wouldn't fail? Thank you.

Btw Tsuru is awesome!

Python pip extra packages

Doest Python platform support extra packages? I mean, the same behavior of call a "pip install "airflow[s3, postgres]""

Add Lua Plataform

  • Add basic platform support
  • Support code deployment
  • Support customized code deployment
  • Add tests

Problem when deploy wordpress app

I have a wordpress app running normally, but when I tryed update it, I receive this error:

remote: Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
remote:  * Stopping Apache httpd web server apache2
remote:  * 
remote: update-rc.d: /etc/init.d/apache2 exists during rc.d purge (use -f to force)
remote: /usr/bin/env: php: No such file or directory
remote: Traceback (most recent call last):
remote:   File "/var/lib/tsuru/php/deploy.py", line 209, in <module>
remote:     manager.install()
remote:   File "/var/lib/tsuru/php/deploy.py", line 92, in install
remote:     self.install_composer()
remote:   File "/var/lib/tsuru/php/deploy.py", line 109, in install_composer
remote:     raise InstallationException('Unable to install composer dependencies')
remote: __main__.InstallationException: Unable to install composer dependencies
remote: Installing system packages...
remote: Install composer dependencies
remote: Composer is not found locally, downloading it
remote: 2016/04/24 15:37:24 exit status 1
remote: Exit status 1
To [email protected]:iblvwordpress.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:iblvwordpress.git'

The error occur in this line - https://github.com/tsuru/platforms/blob/master/php/deploy.py#L108

if os.system('cd %s && %s install' % (self.application.get('directory'), composer_phar)) != 0:
                raise InstallationException('Unable to install composer dependencies')

Accessing the container and following this steps to simulate the error, I receive this error:

$ tsuru app-shell
ubuntu@67bd6a2c8453:/$ cd /home/application/current/
ubuntu@67bd6a2c8453:/home/application/current$ python -c 'import os; os.system("cd /home/application/current && ./composer.phar install")'
Cannot create cache directory /home/ubuntu/.composer/cache/repo/http---wpackagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/ubuntu/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/ubuntu/.composer/cache/files/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update


  [ErrorException]                                                                                                       
  file_put_contents(/home/application/current/vendor/composer/installed.json): failed to open stream: Permission denied  


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

Running with sudo the script is executed normally:

$ python -c 'import os; os.system("cd /home/application/current && sudo ./composer.phar install")'
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files

I think if we change os.system('cd %s && %s install' % (self.application.get('directory') to os.system('cd %s && sudo %s install' % (self.application.get('directory'), composer_phar)), composer_phar))` this problem is resolved.

Custom tsuru.yml name

Please add support to define custom tsuru.yml file name.

In some environments (like ours) an application yml config already exists to configure our services, would be better to use the same file for app configuration insted creating two different file (for example, our application.yml and tsuru.yml)

As all platform extents the base-platform, this configuration should be defined in base platform, by using an env variable or similiar.

For example:

export APP_CONFIG=application.yml

if APP_CONFIG is set, all platform should try to use that file as configuration file. If missing, standard tsuru.yml should be used.

buildpacks: drop support to basebuilder

Originally open by @guestisp:

I've seen that support di heroku style buildpack was added.
If so, why not dropping support to basebuilder and just using only buildpacks?
Buildpacks are much more flexible and less components to maintain in a tsuru installation.

Add support to PHP 7

We can create a php 7 support in tsuru php platform without create a new platform?

Ruby: warning message when specifying minor version

After setting the Ruby version in my project as 2.2.3, I started getting this warning message during deploy:

remote: WARNING: Invalid ruby version, please use 1.9.1, 1.9.3, 2.0, 2.1 or 2.2. Using ruby 2.2 as fallback.
remote: -- Using ruby version: 2.2.3 --

Nodejs: yarn install prompt with invalid package version

When you set an invalid version of a package, yarn install shows a prompt waiting for the user to select another version of that package, locking the app deploy.

Exemple: When I add "dependencies": { "jquery": "3.3.0" } to the package.json file:

[1/4] Resolving packages...
Couldn't find any versions for "jquery" that matches "3.3.0"
? Please choose a version of "jquery" from this list: (Use arrow keys)
❯ 3.2.1
  3.2.0
  3.1.1

Nginx version

I've been investigating that the Nginx server version is a bit outdated. The response headers tell, that Nginx in version 1.4.6 serves the site.
grafik

$ tsuru app-shell -a php-sample
ubuntu@35849ec8db7b:/home/application/current$ nginx -v
nginx -v
nginx version: nginx/1.4.6 (Ubuntu)
ubuntu@35849ec8db7b:/home/application/current

Issuing the commands above tells the same.

Nginx 1.4.6 was released 2014. Current stable version is 1.14.2.

So how can I update the nginx version? Updating the server everytime deploying an app is not an option for me.

Best regards,
David

Can't select python 3.6 on platform

Hi
when triying to select python 3.6 on python platform with build process warn about there is not 3.6 version and select the closest 3.5-5

root@tsurudev:~/python36test# git push tsuru master 
Counting objects: 5, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 264 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: tar: Removing leading `/' from member names
remote: Exact python version '3.6.2' (.python-version file) is not supported.
remote: Closest version is 'pypy3.5-5.10.1'.
remote: -- Using python version: pypy3.5-5.10.1 (.python-version file (closest)) --

I had try with 3.6.2 and with 3.6.5 that is on tsuru/python /var/lib/pyenv/versions/ directory but not selected

regards

Python platform: support for Python 3.7

Hello, it would be good if the Python platform provided support to the newer version. It looks like that python 3.7 requires openssl 1.0.2, so it could be tricky to make it work on Ubuntu 14.04.

NodeJS: no way to use dev-dependencies for build

The NodeJS platform use dependencies for runtime dependencies and devDependencies for development/testing ones [1].
Build tools, like babel, are not required on final image on production. But tsuru does not install it on build, forcing to move these dependencies and install it all. This increases the final image.

It can be handled using a docker file with multistage build [2].

Isn't possible to add this to the nodejs platform?

[1] - https://docs.npmjs.com/specifying-dependencies-and-devdependencies-in-a-package-json-file
[2] - https://docs.docker.com/develop/develop-images/multistage-build/

add tests for platforms

We can now do simple assertions on the environment installed by the platform. It would be good to at those kind of tests for other platforms as well, just like we did for ruby. It`s just a matter of adding a directory with the name of the platform inside the tests directory and adding .bats files inside.

  • buildpack
  • cordova
  • elixir
  • go
  • java
  • nodejs
  • php
  • play
  • pypy
  • python
  • python3
  • ruby
  • static

Latest go platform installing go 1.9.3 is not stable

Latest go platform fails with the error sed: can't read : No such file or directory.

git push tsuru master
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 438 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: HEAD is now at cedbac7... Initail commit
remote: ---- Pulling image to node ----
remote: latest: Pulling from tsuru/go
remote: Digest: sha256:43fd10289d77fcbcd0cdab10377f51b8605fe5734efda3d561d66d32836b5b95
remote: Status: Image is up to date for 192.168.99.4:5000/tsuru/go:latest
remote: /bin/sh: 27: source: not found
remote: go version go1.9.3 linux/amd64
remote: go version go1.9.3 linux/amd64
remote: Installing Go stable...
remote: sed: can't read : No such file or directory
remote: Procfile not found. Using default Procfile
remote: go build -o tsuru-app
remote:
remote: ---- Building image ----
remote:  ---> Sending image to repository (386.57MB)
remote:  ---> Cleaning up
remote: /bin/sh: 27: source: not found
remote: ---- Running build hooks ----
remote:
remote: ---- Deploying application image ----
remote:  ---> Sending image to repository (0.00MB)
remote:  ---> Cleaning up
remote:
remote: ---- Starting 1 new unit [web: 1] ----
remote:  ---> Started unit 8c55272c2a [web]
remote:
remote: ---- Binding and checking 1 new unit ----
remote:  ---> Bound and checked unit 8c55272c2a [web]
remote:
remote: ---- Adding routes to new units ----
remote:  ---> Added route to unit 8c55272c2a [web]
remote:
remote: ---- Setting router healthcheck (Path: /) ----
remote:
remote: OK

Because of this the application build doesn't go through, with the following error

2018-02-13 14:45:38 +0530 [tsuru]: Logs initialization
2018-02-13 14:53:00 +0530 [tsuru][api]: go version go1.9.3 linux/amd64
2018-02-13 14:53:00 +0530 [tsuru][api]: go version go1.9.3 linux/amd64
2018-02-13 14:53:00 +0530 [tsuru][api]: Installing Go stable...
2018-02-13 14:53:02 +0530 [tsuru][api]: sed: can't read : No such file or directory
2018-02-13 14:53:42 +0530 [tsuru][api]: Procfile not found. Using default Procfile
2018-02-13 14:53:42 +0530 [tsuru][api]: go build -o tsuru-app
2018-02-13 14:53:43 +0530 [tsuru][api]: ---- Running build hooks ----

and it is stuck at this stage and error out finally.
It is causing the build to fail and thus the following error.

2018-02-13 16:47:16 +0530 [web][8c55272c2ad6]: /bin/sh: 27: source: not found
2018-02-13 16:47:16 +0530 [web][8c55272c2ad6]: /bin/sh: 1: exec: ./tsuru-app: Permission denied

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.