stevieb9 / berrybrew

Perlbrew for Windows!
Other
63 stars 9 forks source link

Can berrybrew run inside docker containers? (Perl instances within network shares) #301

Closed versionaire closed 2 years ago

versionaire commented 2 years ago

Hello,

This is not an issue but a question. Are you aware if berrybrew will work inside docker containers and if so are there any major issues?

I work in a large perl shop and we are migrating much of our workload to docker automation. We would like to spin up containers and use berrybrew to access perl mounted versions from a local resource. In this manner we could have static perls with pre-installed modules. Currently our overseas development team spins up an image, installs perl and then begins installing various modules. For each instance. We had thought berrybrew might be a solution to get around these bottlenecks.

stevieb9 commented 2 years ago

I have never tried it, but I can't see that it wouldn't work.

If I understand correctly, you want to mount a local or network drive into a docker container, and have berrybrew operate Perl instances that are located on that shared drive?

I assume that you'd preconfigure berrybrew to point to the right place initially, and if you upgrade perls in the future, you'd update the base image?

If you can confirm, I'll gladly do some initial testing, and if it doesn't work, make it so that it does.

On Wed, Jul 28, 2021 at 9:15 AM Tim White @.***> wrote:

Hello,

This is not an issue but a question. Are you aware if berrybrew will work inside docker containers and if so are there any major issues?

I work in a large perl shop and we are migrating much of our workload to docker automation. We would like to spin up containers and use berrybrew to access perl mounted versions from a local resource. In this manner we could have static perls with pre-installed modules. Currently our overseas development team spins up an image, installs perl and then begins installing various modules. For each instance. We had thought berrybrew might be a solution to get around these bottlenecks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stevieb9/berrybrew/issues/301, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDQEP3S3QISKIZEGYAL3G3T2AUJZANCNFSM5BEV6QRQ .

versionaire commented 2 years ago

That is exactly what we'd like to do. In our container we have SMB (windows) mounted shares and each container instance installs Perl and then a list of modules. Our team is assembling a different set of modules for each job we have (and we have maybe 1500) and in production we have a static Perl (with all the modules needed already installed). Production Perl changes rarely. Berrybrew looks perfect because we could start the container and berrybrew the correct version. I'm going to attempt to containerize berrybrew and will come back shortly with how we made out in our efforts. Thank you stevieb9 for quick response.

stevieb9 commented 2 years ago

Let me know if you have any problems, and I'll work on the issue promptly. If you've got a method in which I could work within your actual environment to make any changes, that would be extremely beneficial, as it's been some time since I've done anything with containers etc.

On Thu, Jul 29, 2021 at 8:04 AM Tim White @.***> wrote:

That is exactly what we'd like to do. In our container we have SMB (windows) mounted shares and each container instance installs Perl and then a list of modules. Our team is assembling a different set of modules for each job we have (and we have maybe 1500) and in production we have a static Perl (with all the modules needed already installed). Production Perl changes rarely. Berrybrew looks perfect because we could start the container and berrybrew the correct version. I'm going to attempt to containerize berrybrew and will come back shortly with how we made out in our efforts. Thank you stevieb9 for quick response.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stevieb9/berrybrew/issues/301#issuecomment-889223243, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDQEP4W3FE2254XOIWN4DDT2FUZFANCNFSM5BEV6QRQ .

versionaire commented 2 years ago

I'm attempt to build a Perl outside the container that I can access inside. I've installed berrybrew and used the default top level directory (c:\berrybrew) for my Perl versions. I added a half dozen modules and then zipped that folder up, copied and then unzipped to a samba file share. and renamed the original top level directory. I do this because installing as admin means share rights are dropped (or changed). My mapped share I can see, I can run perl and use a module from that folder. But I cannot berrybrew register the folder. I get installation directory 't:\path\container_perls' does not exist. When I run the register command a c:\berrybrew is created. So I put the original folder back in place and still I can run dir on the t: folder but cannot register the directory.

stevieb9 commented 2 years ago

OK. It sounds like the register process isn't able to see network share directories. I'll set up a similar situation here (mount a shared Samba drive) and see what I can come up with.

On Thu, Jul 29, 2021 at 12:10 PM Tim White @.***> wrote:

I'm attempt to build a Perl outside the container that I can access inside. I've installed berrybrew and used the default top level directory (c:\berrybrew) for my Perl versions. I added a half dozen modules and then zipped that folder up, copied and then unzipped to a samba file share. and renamed the original top level directory. I do this because installing as admin means share rights are dropped (or changed). My mapped share I can see, I can run perl and use a module from that folder. But I cannot berrybrew register the folder. I get installation directory 't:\path\container_perls' does not exist. When I run the register command a c:\berrybrew is created. So I put the original folder back in place and still I can run dir on the t: folder but cannot register the directory.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stevieb9/berrybrew/issues/301#issuecomment-889390971, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDQEP3DE33YR2EBUVQZMNDT2GRSRANCNFSM5BEV6QRQ .

stevieb9 commented 2 years ago

What version of berrybrew are you running (berrybrew version)?

On Thu, Jul 29, 2021 at 12:10 PM Tim White @.***> wrote:

I'm attempt to build a Perl outside the container that I can access inside. I've installed berrybrew and used the default top level directory (c:\berrybrew) for my Perl versions. I added a half dozen modules and then zipped that folder up, copied and then unzipped to a samba file share. and renamed the original top level directory. I do this because installing as admin means share rights are dropped (or changed). My mapped share I can see, I can run perl and use a module from that folder. But I cannot berrybrew register the folder. I get installation directory 't:\path\container_perls' does not exist. When I run the register command a c:\berrybrew is created. So I put the original folder back in place and still I can run dir on the t: folder but cannot register the directory.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stevieb9/berrybrew/issues/301#issuecomment-889390971, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDQEP3DE33YR2EBUVQZMNDT2GRSRANCNFSM5BEV6QRQ .

versionaire commented 2 years ago

I should have tried the unc path too (\server\path) to be thorough. I'm running 1.34.

stevieb9 commented 2 years ago

Can you please run berrybrew options and paste me the results of that command?

versionaire commented 2 years ago

Steve, options output below. Since I could not install to a samba share (referenced by drive letter) I installed to the c: drive and then moved the folder which I then could not register (maybe I could have modified the registry). I want to build a berrybrew on a share , add modules, and then access the berrybrewed perl on that share from a docker container. As I understand from our developers berrybrew would have to be installed without a GUI. I read it's possible but not the way they are building our jobs. So I'd thought unzip and try regedit commands. I am very grateful for your efforts here. Thanks again.

Option configuration:

    debug:             false
    root_dir:          C:\berrybrew
    temp_dir:          C:\berrybrew\temp
    download_url:      https://strawberryperl.com/releases.json
    windows_homedir:   false
    custom_exec:       false
    run_mode:          prod
    file_assoc:        Perl_program_file
    file_assoc_old:
    warn_orphans:      false
stevieb9 commented 2 years ago

I do think the only step you missed was updating the registry. I reproduced the problem:

Fix:

Now, using the graphical installer, this is even simpler:

Here's what my options look like now:

c:\repos\berrybrew>berrybrew options

Option configuration:

    debug:             false
    root_dir:          \\scelia\shared\berrybrew
    temp_dir:          \\scelia\shared\berrybrew\temp
    download_url:      https://strawberryperl.com/releases.json
    windows_homedir:   false
    custom_exec:       false
    run_mode:          prod
    file_assoc:
    file_assoc_old:
    warn_orphans:      false

If the base container has berrybrew set up this way, things should just work. If you add a new perl and want to switch to it and use it by default, the base container will have to be updated as such.

Let me know if this helps!

On Sun, Aug 1, 2021 at 10:59 AM Tim White @.***> wrote:

Steve, options output below. Since I could not install to a samba share (referenced by drive letter) I installed to the c: drive and then moved the folder which I then could not register (maybe I could have modified the registry). I want to build a berrybrew on a share , add modules, and then access the berrybrewed perl on that share from a docker container. As I understand from our developers berrybrew would have to be installed without a GUI. I read it's possible but not the way they are building our jobs. So I'd thought unzip and try regedit commands. I am very grateful for your efforts here. Thanks again.

Option configuration:

debug:             false
root_dir:          C:\berrybrew
temp_dir:          C:\berrybrew\temp
download_url:      https://strawberryperl.com/releases.json
windows_homedir:   false
custom_exec:       false
run_mode:          prod
file_assoc:        Perl_program_file
file_assoc_old:
warn_orphans:      false

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stevieb9/berrybrew/issues/301#issuecomment-890562155, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDQEPZ7QBBH35BDCQCBVWTT2WDPNANCNFSM5BEV6QRQ .

stevieb9 commented 2 years ago

This seems to work properly following the correct techniques. Closing as resolved.