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

Getting Auth Policy Error while trying to create a project using nvfalre==2.4 #2419

Open
Writam18 opened this issue Mar 19, 2024 · 5 comments
Assignees

Comments

@Writam18
Copy link

I am trying to stimulate an experiment with the NVIDIA FLARE framework on Kubernetes(K8s). I am trying this on a private cluster. I have installed nvflare==2.4 in the container used by K8s deployments to create overseer, server, and client. But while trying to create a new project using the project.yaml file taken from FLARE documentation using provision API I am getting the following error

No module named 'nvflare.lighter.impl.auth_policy

Additional Info: The same deployment files, and API calls used to work fine with nvflare===2.1.2

@YuanTingHsieh
Copy link
Collaborator

@Writam18 can you share the actually file or link of "project.yaml" that you are using?

Can you also share the command you run?
Please also share your python version (python3 -V) and nvflare version (python3 -m pip list | grep "nvflare")

@Writam18
Copy link
Author

Writam18 commented Apr 5, 2024

@YuanTingHsieh

The above-mentioned error occurs while I am trying to create a new experiment using provision API.

from nvflare.lighter.spec import Participant, Project, Provisioner
from nvflare.lighter.utils import load_yaml

project_dict = load_yaml(proejct_full_path)
api_version = project_dict.get("api_version")
project_name = project_dict.get(name)
participants = list()
for p in project_dict.get("participants"):
participants.get(**p)
project = Project(name=project_name, participants=participants)

builders = list()
for b in project_dir.get("builders"):
path=b.get("path")
args=b.get("args")
builders.append(instantiate_class(path,args))

provisioner = Provisioner(workspace_full_path, builders)
provisioner.provision(project)

Python and nvflare version

python3 -V
Python 3.8.18
python3 -m pip list | grep nvflare
nvflare 2.4.0

The project.yaml file is attached.
project_yaml.txt

@YuanTingHsieh
Copy link
Collaborator

YuanTingHsieh commented Apr 5, 2024

@IsaacYangSLA can you help comment on this provision issue from 2.1.2 to 2.4 thanks!

@IsaacYangSLA
Copy link
Collaborator

The format of project.yml file changed between 2.1 and 2.4. Please first rename your original project.yml file. Then do nvflare provision to generate a new project.yml file. That newly generated project.yml will work fine with the NVFlare of your current version.

@YuanTingHsieh
Copy link
Collaborator

@Writam18

Please try use this new project.yml:

api_version: 3
name: example_project
description: NVIDIA FLARE sample project yaml file

participants:
  # change overseer.example.com to the FQDN of the overseer
  - name: overseer
    type: overseer
    org: nvidia
    protocol: https
    api_root: /api/v1
    port: 8443
  # change example.com to the FQDN of the server
  - name: server
    type: server
    org: nvidia
    fed_learn_port: 8002
    admin_port: 8003
  - name: example2.com
    type: server
    org: nvidia
    fed_learn_port: 8002
    admin_port: 8003
  - name: client1
    type: client
    org: nvidia
  - name: client2
    type: client
    org: nvidia
  - name: admin@nvidia.com
    type: admin
    org: nvidia
    role: project_admin

# The same methods in all builders are called in their order defined in builders section
builders:
  - path: nvflare.lighter.impl.workspace.WorkspaceBuilder
    args:
      template_file: master_template.yml
  - path: nvflare.lighter.impl.template.TemplateBuilder
  - path: nvflare.lighter.impl.static_file.StaticFileBuilder
    args:
      # config_folder can be set to inform NVIDIA FLARE where to get configuration
      config_folder: config

      # scheme for communication driver (currently supporting the default, grpc, only).
      # scheme: grpc

      # app_validator is used to verify if uploaded app has proper structures
      # if not set, no app_validator is included in fed_server.json
      # app_validator: PATH_TO_YOUR_OWN_APP_VALIDATOR

      # when docker_image is set to a docker image name, docker.sh will be generated on server/client/admin
      # docker_image:

      # download_job_url is set to http://download.server.com/ as default in fed_server.json.  You can override this
      # to different url.
      # download_job_url: http://download.server.com/

      overseer_agent:
        path: nvflare.ha.overseer_agent.HttpOverseerAgent
        # if overseer_exists is true, args here are ignored.  Provisioning
        #   tool will fill role, name and other local parameters automatically.
        # if overseer_exists is false, args in this section will be used.
        overseer_exists: true
        # args:
        #   sp_end_point: example1.com.8002:8003

  - path: nvflare.lighter.impl.cert.CertBuilder
  # - path: nvflare.lighter.impl.he.HEBuilder
  #   args:
  #     poly_modulus_degree: 8192 
  #     coeff_mod_bit_sizes: [60, 40, 40]
  #     scale_bits: 40
  #     scheme: CKKS
  - path: nvflare.lighter.impl.signature.SignatureBuilder

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

No branches or pull requests

3 participants