Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider extending default ignore list on pack #810

Open
DifferentialOrange opened this issue Mar 29, 2024 · 6 comments
Open

Consider extending default ignore list on pack #810

DifferentialOrange opened this issue Mar 29, 2024 · 6 comments
Labels

Comments

@DifferentialOrange
Copy link
Member

DifferentialOrange commented Mar 29, 2024

Now tt pack ignores some files (for example, .git and .gitignore) on artifact packing by default. There are some popular scenarios that seems to better be covered by default.

Command packs previous artifact

$ tt create vshard_cluster --name myapp290324
   • Creating application in "/home/moiseevgeorgy/Development/sandbox/myapp290324"
   • Using built-in 'vshard_cluster' template.
Bucket count (default: 3000): 
Storage replication sets count (default: 2): 
Storage replicas per replication set count (>=2) (default: 2): 
Routers count (default: 1): 
   • Application 'myapp290324' created successfully
What's next?
Build and start 'myapp290324' application:
    $ tt build myapp290324
    $ tt start myapp290324

Pay attention that default passwords were generated,
you can change it in the config.yaml.
$ cd ./myapp290324/
$ tt init
$ tt pack
$ tt pack tgz
   • Generating new tt.yaml for the new package
   • Apps to pack: myapp290324 
   • Running rocks make       
No existing manifest. Attempting to rebuild...
   • Application was successfully built
   • myapp290324 rocks are built successfully
   • Creating tarball.        
   • Bundle is packed successfully to /home/moiseevgeorgy/Development/sandbox/myapp290324/myapp290324-0.1.0.0.x86_64.tar.gz.
$ tar -ztvf myapp290324-0.1.0.0.x86_64.tar.gz 
drwx------ moiseevgeorgy/moiseevgeorgy 0 2024-03-29 17:53 .
drwxr-x--- moiseevgeorgy/moiseevgeorgy 0 2024-03-29 17:53 bin
...
drwxr-x--- moiseevgeorgy/moiseevgeorgy        0 2024-03-29 17:53 myapp290324/templates
-rw-r--r-- moiseevgeorgy/moiseevgeorgy     1495 2024-03-29 17:53 myapp290324/tt.yaml
-rw-rw-r-- moiseevgeorgy/moiseevgeorgy      365 2024-03-29 17:53 tt.yaml

Rebuild the artifact after some changes.

$ tt pack tgz
$ tar -ztvf myapp290324-0.1.0.0.x86_64.tar.gz 
drwx------ moiseevgeorgy/moiseevgeorgy 0 2024-03-29 17:55 .
drwxr-x--- moiseevgeorgy/moiseevgeorgy 0 2024-03-29 17:55 bin
...
-rw-rw-r-- moiseevgeorgy/moiseevgeorgy 25630806 2024-03-29 17:55 myapp290324/myapp290324-0.1.0.0.x86_64.tar.gz
...
drwxr-x--- moiseevgeorgy/moiseevgeorgy        0 2024-03-29 17:55 myapp290324/templates
-rw-r--r-- moiseevgeorgy/moiseevgeorgy     1495 2024-03-29 17:55 myapp290324/tt.yaml
-rw-rw-r-- moiseevgeorgy/moiseevgeorgy      365 2024-03-29 17:55 tt.yaml

Rebuild the artifact after more changes.

$ tt pack tgz
$ tar -ztvf myapp290324-0.1.0.0.x86_64.tar.gz 
drwx------ moiseevgeorgy/moiseevgeorgy 0 2024-03-29 17:56 .
drwxr-x--- moiseevgeorgy/moiseevgeorgy 0 2024-03-29 17:56 bin
...
-rw-rw-r-- moiseevgeorgy/moiseevgeorgy 51182800 2024-03-29 17:56 myapp290324/myapp290324-0.1.0.0.x86_64.tar.gz
...
-rw-r--r-- moiseevgeorgy/moiseevgeorgy     1495 2024-03-29 17:56 myapp290324/tt.yaml
-rw-rw-r-- moiseevgeorgy/moiseevgeorgy      365 2024-03-29 17:56 tt.yaml

And so on.

Command packs credentials file

$ cat tt.yaml
ee:
  credential_path: ./credentials.txt
$ cat credentials.txt
mylogin
mypassword
$ tt pack tgz
$ tar -ztvf myapp290324-0.1.0.0.x86_64.tar.gz
drwx------ moiseevgeorgy/moiseevgeorgy 0 2024-03-29 18:03 .
drwxr-x--- moiseevgeorgy/moiseevgeorgy 0 2024-03-29 18:03 bin
...
-rw------- moiseevgeorgy/moiseevgeorgy       20 2024-03-29 18:03 myapp290324/credentials.txt
...
-rw-r--r-- moiseevgeorgy/moiseevgeorgy      1495 2024-03-29 18:03 myapp290324/tt.yaml
-rw-rw-r-- moiseevgeorgy/moiseevgeorgy       365 2024-03-29 18:03 tt.yaml
@psergee
Copy link
Collaborator

psergee commented Mar 30, 2024

Why do we need to chdir to the application directory and create one more env there? Why is this a popular scenario?

@DifferentialOrange
Copy link
Member Author

Why do we need to chdir to the application directory and create one more env there?

I chdir to application directory to develop my application. I create env per application since this is the way I usually work with local environment: Lua rocks, Python venv, git. If it is forbidden, let's forbid to work like this in documentation and, if possible, with tt init call. As far as I remember env discussions, it was planned that env inside the application is fine.

Why is this a popular scenario?

Do we have any statistics or independent research on non-tt developers which scenarios are popular? I think we're not.

@DifferentialOrange
Copy link
Member Author

DifferentialOrange commented Apr 1, 2024

tt init --help says

Create tt environment config for application in current directory

and for me it sounds like it encourages to create per-application env, not forbids it.

@psergee
Copy link
Collaborator

psergee commented Apr 1, 2024

let's forbid to work like this in documentation

Cannot be forbidden due to cartridge-cli compatibility.

Do we have any statistics or independent research on non-tt developers which scenarios are popular?

There are some popular scenarios

Please ask the author of the comment above.

@DifferentialOrange
Copy link
Member Author

Please ask the author of the comment above.

Yeah, that's fair. Do we have a proper step-by-step guide on how to work with tt-compatible application (full cycle, not separate commands)? It seems that my understanding of the approach is not the same as you have.

@DifferentialOrange
Copy link
Member Author

By popular scenarios, I have meant "re-pack application that has been packed some time ago" and "pack application if I work with credentials". If my issues do not directly tied to these but to some other things -- let's at least fixate it here.

psergee added a commit that referenced this issue Jun 3, 2024
Ignore packagaging of previously packaged environments.

Part of #810
psergee added a commit that referenced this issue Jun 3, 2024
Ignore packagaging of previously packaged environments.

Part of #810
psergee added a commit that referenced this issue Jun 4, 2024
Ignore packagaging of previously packaged environments.

Part of #810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants