Giter Site home page Giter Site logo

cloud66-oss / starter Goto Github PK

View Code? Open in Web Editor NEW
306.0 306.0 55.0 2.86 MB

Helping you get started with containerized apps.

Home Page: https://www.cloud66.com/opensource-software/

License: Apache License 2.0

Shell 0.46% Go 93.59% Ruby 3.38% Dockerfile 2.46% Procfile 0.12%
cloud66 containers dockerfile dokcer

starter's People

Contributors

bartolottiluca avatar dependabot[bot] avatar dimitrioslisenko avatar dragospopa avatar foldingbeauty avatar kasia66 avatar khash avatar lvangool avatar remyferre 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  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  avatar  avatar  avatar

starter's Issues

Can't make it work

I'm not sure if this is the best place for this, so apologies if not, but I can't make the tool work correctly.

In the first instance, I run the starter -g dockerfile,service,docker-compose command, but this just tells me:

flag provided but not defined: -g
Usage of starter:
  -branch string
    	template branch in github (default "master")
  -e string
    	set project environment (default "production")
  -overwrite
    	overwrite existing files
  -p string
    	project path
  -templates string
    	location of the templates directory
  -y	do not prompt user

So I try again using starter dockerfile,service,docker-compose, which seems to have some more joy, allowing me to answer questions about my project, but then fails on:

 Failed to write service.yml due to: template: service.yml.template:29:6: executing "service.yml.template" at <.Name>: can't evaluate field Name in type string

Which generates the following files:

Dockerfile

# Generated by Cloud66 Starter
FROM ruby:2.3.1

RUN apt-get update -qq && apt-get install -y build-essential nodejs imagemagick libmagickwand-dev

ENV APP_HOME /app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME

ADD Gemfile* $APP_HOME/
RUN bundle install

ADD . $APP_HOME

service.yml

---
services:

##NEWLINE##
  web:
    git_url: [email protected]
    git_branch: master
    command: bundle exec puma -p _env:PORT -C ./config/puma.rb
    build_command: /bin/sh -c "RAILS_ENV=_env:RAILS_ENV bundle exec rake db:schema:load"
    deploy_command: /bin/sh -c "RAILS_ENV=_env:RAILS_ENV bundle exec rake db:migrate"
    build_root: .

    ports:
      - container: 3000
        http: 80
        https: 443
        
        
    

    env_vars:
      RAILS_ENV: production
    
      RACK_ENV: production
    

##NEWLINE##
  worker:
    git_url: [email protected]
    git_branch: master
    command: bundle exec rake jobs:work
    
    
    build_root: .

    

    env_vars:
      RAILS_ENV: production
    
      RACK_ENV: production
    



##NEWLINE##
databases:
  - 

The app in question is a Rails app based off suspenders.

Failed to write docker-compose.yml

I am using latest version of starter 1.0.2 and getting this error:

Failed to write docker-compose.yml due to: template: docker-compose.yml.template:19:6: executing "docker-compose.yml.template" at <.Name>: can't evaluate field Name in type string

Starter command not found

Hi Team,
I have downloaded the file and ran the install script but the starter command isn't being recognized, can you please help.
Installing Starter V1.4.1
Downloading Starter for Linux x64...
##################################################################################################################### 100.0%
Copying Starter to /home/ec2-user/.starter/starter ...
Making starter command executable ...
Creating Starter symlink in /usr/local/bin/starter ...
The 'starter' command should now be available
Successfully installed Starter! Go build some images!

[ec2-user@ip-172-31-XX-XX starter-1.4.2]$ starter
-bash: starter: command not found

Java, spring framework ] "Failed to detect supported framework"

I have a SpringBoot project and, tried

  1. download Starter releases (https://github.com/cloud66-oss/starter/releases/latest)
    in docker ubuntu:18.04 image
  2. cp starter to /usr/local/bin/starter
  3. chmod a+x /usr/local/bin/starter
  4. export starter=/usr/local/bin/starter
  5. cd /my/project
  6. starter -g dockerfile,service,docker-compose
root@875dcba9e6af:/home/springboot-jsp-demo# starter -g dockerfile,service,docker-compose
 Starter (c) 2019 Cloud66 Inc.
 Checking templates in /root/.starter
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json
 Local templates are up to date
 Detecting framework for the project at /home/springboot-jsp-demo
 Failed to detect supported framework

Writing service.yml... Failed to write service.yml (and more!)

There are multiple, total failures with this program:

installed start via the bash script as recommended in another issue. The homebrew way still installs a very outdated version.

running starter -g dockerfile,service,docker-compose just results in:

$ starter -g dockerfile,service,docker-compose
flag provided but not defined: -g
Usage of starter:
  -branch string
    	template branch in github (default "master")
  -e string
    	set project environment (default "production")
  -overwrite
    	overwrite existing files
  -p string
    	project path
  -templates string
    	location of the templates directory
  -y	do not prompt user

Next tried running just starter... get the following output:

$ starter
 Cloud 66 Starter ~ (c) 2016 Cloud 66
 Checking templates in /Users/nnn/.starter
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json
 Local templates are up to date
 Detecting framework for the project at /Users/nnn/projects/project_name
 Found ruby application
 Enter ruby version: [latest]
 ----> Found config/database.yml
 Found postgresql, confirm? [Y/n] Y
 Found redis, confirm? [Y/n] Y
 Add any other databases? [y/N] N
 ----> Analyzing dependencies
 This command will be run after each build: '/bin/sh -c "RAILS_ENV=_env:RAILS_ENV bundle exec rake db:schema:load"', confirm? [Y/n] Y
 This command will be run after each deployment: '/bin/sh -c "RAILS_ENV=_env:RAILS_ENV bundle exec rake db:migrate"', confirm? [Y/n] Y
 ----> Writing Dockerfile...
 ----> Writing service.yml...
 Failed to write service.yml due to: template: service.yml.template:29:6: executing "service.yml.template" at <.Name>: can't evaluate field Name in type string

Ignore Procfile "web" directive

We use custom_web instead of the web directive - this should populate the service command field if available. If not there should be a standard command for Rails apps.

Example (with our Discourse app):


---
services:
  web:
    git: [email protected]:cloud66-samples/discourse.git
    git_branch: master
    command: bundle exec rails server -p _env:PORT
    ports:
      - 9292:80:443
    env_vars:
      RAILS_ENV: production
      RACK_ENV: production
  worker:
    git: [email protected]:cloud66-samples/discourse.git
    git_branch: master
    command: bundle exec sidekiq -e _env:RAILS_ENV
    env_vars:
      RAILS_ENV: production
      RACK_ENV: production
databases:
  - postgresql
  - redis

Also note that the port attribution is incorrect (should be port 3000).

Failed to write service.yml

With c66starter-1.0.2
starter -overwrite dockerfile,service,docker-compose raises

Failed to write service.yml due to: template: service.yml.template:29:6: executing
"service.yml.template" at <.Name>: can't evaluate field Name in type string

and docker-compose does not get created.

Add a gofish package

Would be great to be able to install it and update it with the gofish go package installer.

Figure out best way to add production web server

Current builds will use Webrick, which is extremely slow.

Adding thin to Gemfile is one option, but requires touching users' code... I tried adding RUN bundle exec gem install thin to Dockerfile after bundle install but it still uses Webrick.

Using Passenger probably isn't great as it requires Nginx in the container as well.

coloring not supported in windows

In Windows (10 Home) terminal coloring not working.

It output weird text at the start

?[92m Starter (c) 2019 Cloud66 Inc.
?[0m?[35m Checking templates in C:\Users\<user-name>\.starter

build fail error

Probably due to incompatible golang versions

Step 7/11 : RUN go get github.com/onsi/gomega
 ---> Running in 3c2a9a295f27
#github.com/onsi/gomega
src/github.com/onsi/gomega/gomega_dsl.go:312: syntax error: unexpected = in type declaration
src/github.com/onsi/gomega/gomega_dsl.go:338: syntax error: unexpected = in type declaration
src/github.com/onsi/gomega/gomega_dsl.go:352: syntax error: unexpected = in type declaration
ERROR: Service 'starter' failed to build: The command '/bin/sh -c go get github.com/onsi/gomega' returned a non-zero code: 2

Failed to write service.yml

tarter (c) 2019 Cloud66 Inc.
Checking templates in /home/backoffice/.starter
----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json
No local templates found. Downloading now.
----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json
----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/node.dockerfile.template
----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/python.dockerfile.template
----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/ruby.dockerfile.template
----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/php.dockerfile.template
----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/service.yml.template
----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/docker-compose.yml.template
Local templates are up to date
Detecting framework for the project at /srv/http/wildcard.example.org/public_html/crm
Found node application
Found php application
More than one framework detected. Please choose which of the following should be used:
NODE
PHP
PHP
Enter php version: [latest] 7.4
Found mysql, confirm? [Y/n] y
Add any other databases? [y/N] y
See http://help.cloud66.com/building-your-stack/docker-service-configuration#database-configs for complete list of possible values
Example: 'mysql elasticsearch'

mysql crm_dev
----> Writing Dockerfile...
----> Writing service.yml...
Failed to write service.yml due to: template: service.yml.template:21:9: executing "service.yml.template" at <.Tags>: can't evaluate field Tags in type *common.Service%

[Feature request] Running starter outside of the Docker folder structure

Hello. I would like to request a feature that starter:

  • even when using Docker binaries, would be able to working outside of it's folder structure

  • would have build-in list of framework types, from with user could select thru the CLI (this would solve the issues, like #117 )

Adventages of implementation:

Above proposal would increase the development speed, since it would remove the need of putting the files inside of the Docker related folders and would resolve some problems that would prevent it from working correctly

Set git branch to current branch

The service.yml currently generated sets branch to master by default, even though I may be on another branch. It should use the current branch I'm on.

Procfile not found if not specifying directory flag

$ starter
 Cloud 66 Starter - (c) 2015 Cloud 66
 Detecting framework for the project at /usr/local/bin/starter
 Found ruby application
 ----> Found Mysql
 ----> Found PostgreSQL
 Failed to write Dockerfile due to open templates/ruby.dockerfile.template: no such file or directory
 Parsing Procfile
 Failed to parse Procfile due to open /usr/local/bin/starter/Procfile: not a directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x31eb]

goroutine 16 [running]:
runtime.panic(0x16d260, 0x2774c4)
    /usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
main.main()
    /home/shab/Projects/go/src/github.com/cloud66/starter/main.go:84 +0x10db

goroutine 19 [finalizer wait]:
runtime.park(0x17690, 0x27a1d0, 0x279589)
    /usr/local/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x27a1d0, 0x279589)
    /usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /usr/local/go/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1445

It's looking for Procfile in directory of executable rather than current path. Looks like it's happening here: https://github.com/cloud66/starter/blob/dev/main.go#L79

Failed to write Service.yml

I am running starter for rails 5.0.0.rc1 and Dockerfile seems to generate without error, but I get error when writing service.yml.

Failed to write service.yml due to: template: service.yml.template:29:6: executing "service.yml.template" at <.Name>: can't evaluate field Name in type string

service.yml.template:29:6 has this code:

- {{.Name}}

Am I missing anything in config/database.yml file? Please suggest

Failed to download latest templates

Is this expected?

sviridkin@mbp:~/git/github.com/lexfrei/docker$ starter
 Cloud 66 Starter ~ (c) 2016 Cloud 66
 Checking templates in /Users/sviridkin/.starter
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json
 Failed to download latest templates due to Get https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json: dial tcp 151.101.0.133:443: i/o timeout
✗: 1 @ Mon Jun 11 05:23:28 MSK 2018
sviridkin@mbp:~/git/github.com/lexfrei/docker$ curl https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json
{
  "version" : "1.0.2",
  "dockerfiles" : [
    { "name": "node.dockerfile.template", "url" : "https://raw.githubusercontent.com/cloud66/starter/{{.branch}}/templates/node.dockerfile.template"},
    { "name": "python.dockerfile.template", "url" : "https://raw.githubusercontent.com/cloud66/starter/{{.branch}}/templates/python.dockerfile.template"},
    { "name": "ruby.dockerfile.template", "url" : "https://raw.githubusercontent.com/cloud66/starter/{{.branch}}/templates/ruby.dockerfile.template"},
    { "name": "php.dockerfile.template", "url" : "https://raw.githubusercontent.com/cloud66/starter/{{.branch}}/templates/php.dockerfile.template"}
  ],
  "service-ymls" : [
    { "name": "service.yml.template", "url" : "https://raw.githubusercontent.com/cloud66/starter/{{.branch}}/templates/service.yml.template"}
  ],
  "docker-compose-ymls" : [
    { "name": "docker-compose.yml.template", "url" : "https://raw.githubusercontent.com/cloud66/starter/{{.branch}}/templates/docker-compose.yml.template"}
  ]
}

✓ @ Mon Jun 11 05:24:21 MSK 2018
sviridkin@mbp:~/git/github.com/lexfrei/docker$ ping 151.101.0.133 -c1
PING 151.101.0.133 (151.101.0.133): 56 data bytes
64 bytes from 151.101.0.133: icmp_seq=0 ttl=57 time=40.036 ms

--- 151.101.0.133 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 40.036/40.036/40.036/0.000 ms
✓ @ Mon Jun 11 05:24:31 MSK 2018

Service command/port for Padrino/Sinatra apps

The service command/port for Padrino and Sinatra apps is either empty (see #5) or incorrect:


---
services:
  web:
    git: [email protected]:cloud66-samples/padrino-mysql-active_record.git
    git_branch: master
    command: bundle exec rack s _env:$RACK_ENV
    ports:
      - 3000:80:443
    env_vars:
      RAILS_ENV: production
      RACK_ENV: production
databases:
  - mysql

This app runs on 9292 and uses rackup command to start.

Doesn't detect use of ElasticSearch

Repository contains tire gem, and uses Elasticsearch. This isn't added to databases in service config:


---
services:

  web:
    git: [email protected]:cloud66-samples/rails-psql-elasticsearch.git
    git_branch: master
    command:
    ports:
      - 9292:80:443
    env_vars:
      RAILS_ENV: production
      RACK_ENV: production

databases:
  - postgresql

Perhaps we need to implement similar detection from main app for various gems.

Requires template files being available locally

$ starter -p /Users/pkallberg/code/samples/rails-mysql
 Cloud 66 Starter - (c) 2015 Cloud 66
 Detecting framework for the project at /Users/pkallberg/code/samples/rails-mysql
 Found ruby application
 ----> Found Mysql
 ----> Found PostgreSQL
 Failed to write Dockerfile due to open templates/ruby.dockerfile.template: no such file or directory
 Parsing Procfile
 ----> Found Procfile item worker
 ----> Found Procfile item scheduler
 Failed to write services.yml due to open templates/service.yml.template: no such file or directory

 Done

Got around it by specifying the templates directory:

$ starter -p /Users/pkallberg/code/samples/rails-mysql -templates /Users/pkallberg/code/cloud66/starter/templates/
 Cloud 66 Starter - (c) 2015 Cloud 66
 Detecting framework for the project at /Users/pkallberg/code/samples/rails-mysql
 Found ruby application
 ----> Found Mysql
 ----> Found PostgreSQL
 Writing Dockerfile...
 Parsing Procfile
 ----> Found Procfile item worker
 ----> Found Procfile item scheduler
 Writing service.yml...

 Done

Fails to detect Django/Python project

I'm running starter in the root folder of my Django project and get the error message "Failed to detect supported framework". The root folder has a requirements.txt as well as a manage.py file.

Failed to detect supported framework

I have tried to use starter on windows. I always have the error Failed to detect supported framework
What could be the cause, I installed bu downloading from the link provided. Same error when executing starter on Ubuntu 14:

root@test-virtual-machine:/home# ./starter_linux_amd64 -p -g dockerfile /codegen/python_client Starter (c) 2017 Cloud66 Inc. Checking templates in /home/test/.starter ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json No local templates found. Downloading now. ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/node.dockerfile.template ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/python.dockerfile.template ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/ruby.dockerfile.template ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/php.dockerfile.template ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/service.yml.template ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/docker-compose.yml.template Local templates are up to date Detecting framework for the project at -g Failed to detect supported framework

How to install Starter on Windows 11

I tried installing Starter using the latest EXE from the release: windows_amd64_1.4.3.exe

Double-clicking on it didn't help, so I opened a Terminal with Admin right and executed that file. This is what I got:

image

Now, even if I try starter help in the Terminal, it says 'starter' is not recognized. Please help.

Python: "Failed to detect supported framework"

"Starter is an open-source command line tool to generate a Dockerfile and a service.yml file from arbitrary source code."

Sounds great! This is just what I was looking for when I found your app!

I have a Python project that already has a requirements.txt file, a setup.py and setup.cfg files. Environment is in Anaconda, on Ubuntu 18.04.

Installed via

$ sudo cp linux_amd64_1.4.3 /usr/local/bin/starter
$ sudo chmod a+x /usr/local/bin/starter

Running inside my project directory yields...

$ cd [my project]
$ starter -g dockerfile,service,docker-compose
 Starter (c) 2019 Cloud66 Inc.
 Checking templates in /home/shawley/.starter
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json
 No local templates found. Downloading now.
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/templates.json
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/node.dockerfile.template
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/python.dockerfile.template
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/ruby.dockerfile.template
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/php.dockerfile.template
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/service.yml.template
 ----> Downloading from https://raw.githubusercontent.com/cloud66/starter/master/templates/docker-compose.yml.template
 Local templates are up to date
 Detecting framework for the project at /home/shawley/panotti
 Failed to detect supported framework

...and that's all it says. What now? (What was it hoping to detect, and why did it fail?)

If you want to see the project, check here: https://github.com/drscotthawley/panotti

Is this still being maintained? Getting build error

Trying to install Starter 1.4.3 on a Windows 10 machine. I downloaded the latest .exe and ran it, but that seemed to only install the template files to '.starter', and I wasn't able to use the 'starter' command in PowerShell even after a restart, so I downloaded the 1.4.3 source code and tried to build with docker-compose up, but it's failing on a dependency I believe. Here's the CLI output:

PS C:\bin\starter-1.4.3> docker-compose up
WARNING: The PWD variable is not set. Defaulting to a blank string.
Building starter
Step 1/11 : FROM golang:1.7
 ---> 225948c9a8b1
Step 2/11 : MAINTAINER Cloud 66
 ---> Using cache
 ---> b4a5b8751a8c
Step 3/11 : RUN go get github.com/mitchellh/gox
 ---> Using cache
 ---> 9054a2705a1c
Step 4/11 : RUN go get -u github.com/kardianos/govendor
 ---> Using cache
 ---> e97a197e948d
Step 5/11 : RUN go get github.com/tools/godep
 ---> Using cache
 ---> 53c0e877e4e8
Step 6/11 : RUN go get github.com/onsi/ginkgo/ginkgo
 ---> Running in 91d38e331088
package math/bits: unrecognized import path "math/bits" (import path does not begin with hostname)
ERROR: Service 'starter' failed to build : The command '/bin/sh -c go get github.com/onsi/ginkgo/ginkgo' returned a non-zero code: 1

Any idea how to fix this so I can successfully build and use Starter? Appreciate the help and the open source tech!

Ability to consume docker-compose file

Starter should support consuming Docker Compose file and generating Cloud 66 Service yaml file.

This will be done by scanning the source code fot docker-compose.yml or the following command line syntax:

$ starter --in my-compose-file.yml --in-format compose ...

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.