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

feature: parse volumes from image #1145

Merged
merged 1 commit into from
Apr 19, 2018

Conversation

rudyfly
Copy link
Collaborator

@rudyfly rudyfly commented Apr 17, 2018

Ⅰ. Describe what this PR did

parse volumes from image, so pouchd will create a volume that is defined
in image automatically.
In addition, if volume has no size, the disk quota will set to volume.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

run a container with image what have volume

# pouch run --name test -ti --disk-quota 5g --quota-id -1 registry.hub.docker.com/library/mysql:latest df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay         5.0G   16K  5.0G   1% /
tmpfs            64M     0   64M   0% /dev
shm              64M     0   64M   0% /dev/shm
tmpfs            64M     0   64M   0% /run
/dev/sdb2       5.0G   16K  5.0G   1% /var/lib/mysql
tmpfs           2.0G     0  2.0G   0% /sys/firmware
tmpfs           2.0G     0  2.0G   0% /proc/scsi

Ⅴ. Special notes for reviews

Signed-off-by: Rudy Zhang rudyflyzhang@gmail.com

@allencloud
Copy link
Collaborator

CI fails:

----------------------------------------------------------------------
FAIL: /go/src/github.com/alibaba/pouch/test/cli_run_test.go:370: PouchRunSuite.TestRunWithLocalVolume
/go/src/github.com/alibaba/pouch/test/cli_run_test.go:384:
    // check the existence of /mnt/local/function/test
    icmd.RunCommand("stat", "/mnt/local/"+funcname+"/test").Assert(c, icmd.Success)
/go/src/github.com/alibaba/pouch/vendor/github.com/gotestyourself/gotestyourself/icmd/command.go:61:
    t.Fatalf("at %s:%d - %s\n", filepath.Base(file), line, err.Error())
... Error: at cli_run_test.go:384 - 
Command:  stat /mnt/local/TestRunWithLocalVolume/test
ExitCode: 1
Error:    exit status 1
Stdout:   
Stderr:   stat: cannot stat ‘/mnt/local/TestRunWithLocalVolume/test’: No such file or directory
Failures:
ExitCode was 1 expected 0
Expected no error

@codecov-io
Copy link

codecov-io commented Apr 17, 2018

Codecov Report

Merging #1145 into master will decrease coverage by 0.03%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1145      +/-   ##
=========================================
- Coverage   16.03%     16%   -0.04%     
=========================================
  Files         174     173       -1     
  Lines        9995    9967      -28     
=========================================
- Hits         1603    1595       -8     
+ Misses       8275    8255      -20     
  Partials      117     117
Impacted Files Coverage Δ
daemon/mgr/container.go 0% <0%> (ø) ⬆️
ctrd/utils.go 0% <0%> (ø) ⬆️
daemon/mgr/volume.go 0% <0%> (ø) ⬆️
pkg/utils/utils.go 78.22% <0%> (-0.35%) ⬇️
daemon/mgr/cri.go 0% <0%> (ø) ⬆️
daemon/config/config.go

parse volumes from image, so pouchd will create a volume that is defined
in image automatically.
In addition, if volume has no size, the diskquota will set to volume.

Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
@yyb196
Copy link
Collaborator

yyb196 commented Apr 19, 2018

home-dir of pouch is configurable, how does DefaultRootDir change to the same value as home-dir of pouchd

@rudyfly
Copy link
Collaborator Author

rudyfly commented Apr 19, 2018

home-dir of pouch is configurable, how does DefaultRootDir change to the same value as home-dir of pouchd

@yyb196 DefaultRootDir just is used in pouch test, @Letty5411 do you have good ideas?

@yyb196
Copy link
Collaborator

yyb196 commented Apr 19, 2018

LGTM, merge it

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Apr 19, 2018
@yyb196 yyb196 merged commit f992f0f into AliyunContainerService:master Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/storage kind/feature LGTM one maintainer or community participant agrees to merge the pull reuqest. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants