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

Is there a way to have a basic build like the full photon ISO? #1520

Open
aroodgar opened this issue Dec 4, 2023 · 6 comments
Open

Is there a way to have a basic build like the full photon ISO? #1520

aroodgar opened this issue Dec 4, 2023 · 6 comments

Comments

@aroodgar
Copy link

aroodgar commented Dec 4, 2023

Is your feature request related to a problem? Please describe.

The build process of photon takes a lot of time and installs a lot of packages.

Describe the solution you'd like

I want to know if there is a way to configure the build process so that I could get a basic photon ISO file like the official release file of this link

Describe alternatives you've considered

No response

Additional context

No response

@aroodgar aroodgar closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2023
@dcasota
Copy link
Contributor

dcasota commented Dec 4, 2023

Hi,

fyi see the classic recipe below. I built a full x86_64 photon-5.0-0240e5e3c.x86_64.iso a week ago from the 5.0 branch.

Classic because there will be a new way of make build using containers, see #1519 (comment), but I haven't tried it out yet.

Hope this helps.
-Daniel

  1. Choose and configure your builder system host e.g. laptop scenario
    The builder system host suggested consists of VMware Workstation 17 on a x86_64 Windows 11 laptop with enough capacity.

    For this builder system host, it is better to disable Windows powerthrottling.
    powercfg /powerthrottling disable /path "C:\Program Files (x86)\VMware\VMware Workstation\x64\vmware-vmx.exe"

    Provision a Photon OS vm e.g. with e.g. vhw latest, non-TPM, 16 vcpu, 120 GB storage, 32GB ram from photon-minimal-5.0-dde71ec57.x86_64.iso.

  2. Configure the builder system.
    Depending on the environment needs, specify e.g. name, ip, ntp, dns, timezone, ssh settings.

    For multiple workspaces, consider a directory structure e.g.

    mkdir -p /workspaces/ph5prod
    cd /workspaces/ph5prod
    

    Using the latest packages usually is a quick start method.

    tdnf distro-sync -y
    tdnf install -y kpartx git bc build-essential createrepo_c texinfo wget python3-pip tar dosfstools cdrkit rpm-build linux-secure-devel
    python -m pip install --upgrade pip
    pip3 install --upgrade pip
    pip3 install setuptools ez_setup
    # use latest photon-os-installer
    pip3 install docker==2.3.0
    pip3 install git+https://github.com/vmware/photon-os-installer.git
    
  3. Make build e.g. of Photon OS 5.0 latest

    git clone -b 5.0 https://github.com/vmware/photon.git
    cd ./photon
    make -j16 image IMG_NAME=iso THREADS=16
    
  4. Troubleshooting
    If the make build process fails, there are several options.

    • reboot and retry to run make with fewer threads e.g. make image IMG_NAME=iso
    • check the logfiles in the stage directory
    • check disk space
  5. make build
    The first make build takes 6-20 hours. The iso (and a debug version) is stored in the ./stage directory.

    To rerun with latest 5.0 packages, fetch and merge the sources before restarting make image IMG_NAME=iso.

    git fetch
    git merge origin/5.0
    
  6. credits
    Maintaining a builder system host in good shape is crucial for beginners. Thanks to the great support from the Photon OS team, I was able to acquire Linux know-how, especially about Photon OS. I hope the above code snippets are useful.

@sshedi
Copy link
Contributor

sshedi commented Dec 5, 2023

You can do:

sudo make minimal-iso THREADS=8

This takes less time but builds a small iso.

If you are a dev branch user, you can do:

sudo make basic-iso THREADS=8

minimal iso is a small iso with a bunch of cloud env tools & utilities.
basic is also a small iso but with very limited set of tools & utilities which focuses on smaller sized image.

@aroodgar aroodgar reopened this Dec 6, 2023
@aroodgar
Copy link
Author

aroodgar commented Dec 6, 2023

Thanks for the responses.

I think did not ask my question clearly.
What @dcasota said is the same default process of the photon build process.
I want to see if there is a way to get the full photon ISO without all the unnecessary packages being installed during the process. I don't want a minimal version. I just don't want all the packages that are installed in the process to be installed which are around a 1000. I only want those that are actually installed with this image.

@dcasota
Copy link
Contributor

dcasota commented Dec 6, 2023

Hi @aroodgar,

Github comes along with the functionality of tags, see https://github.com/vmware/photon/tags.
From the photon build process perspective, you could use

git clone https://github.com/vmware/photon.git
cd ./photon
git checkout dde71ec

to have the same state as in this image.

Let's say you already have a Photon OS 4.x installation, the actual upgrade does NOT stop on state Ph5 dde71ec .

tdnf upgrade tdnf
tdnf install photon-upgrade
photon-upgrade.sh --upgrade-os --assume-yes

If you need to upgrade to 5.0 by solely using this image, the built-in photon-upgrade.sh has several options --repos, --to-ver , --install-all, but I haven't tried them out to achieve the goal.

Unnecessary packages is very complex in terms of life support. Move open source packages if they no longer function. The reasons can range from lack of community interest to the hardware becoming so rare that it is simply not available any more. If packages in life support are not shown to be working within a reasonable timeframe, move them to an archived status. Imho this is good standing, see https://github.com/vmware-archive.

The build process of photon takes a lot of time and installs a lot of packages.
The build process resiliency of photon has dependencies e.g. the access to the sources on github.
There are different stages during the build process and each stage uses a set of necessary packages to make build other packages. The initial build process for Photon OS allows to distinct "save paths" aka flavors which results in different build process time, but also in different update build process time. Afaik there is no official migration path between flavors.

Hope this helps.
-Daniel

@oliverkurth
Copy link
Contributor

@arrodgar, I don't fully understand your request, I think you need to rephrase.

Do you want to avoid building all packages? Or do you want a smaller ISO image, not with the full set? Or do you want to create a VM but not with all packages? Or something different altogether?

@oliverkurth
Copy link
Contributor

Please see if this answer to a similar request helps you: #1519 (comment)

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

No branches or pull requests

4 participants