Skip to content

Commit

Permalink
Change SAI spec path from absoluate path relative path (#629)
Browse files Browse the repository at this point in the history
In the previous implementation, the SAI spec paths are absolute paths,
which is not flexible if DASH is used as a submodule used by the other
project.

Signed-off-by: Ze Gan <ganze718@gmail.com>
  • Loading branch information
Pterosaur authored Oct 12, 2024
1 parent 46e5ab7 commit 832b053
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dash-pipeline/SAI/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ all: copysrc
/bmv2/dash_pipeline.bmv2/dash_pipeline_p4rt.json \
--ir /bmv2/dash_pipeline.bmv2/dash_pipeline_ir.json \
--ignore-tables=underlay_mac,eni_meter,slb_decap \
--sai-spec-dir=/SAI/specs \
--sai-spec-dir=specs \
dash

copysrc:
Expand Down
30 changes: 15 additions & 15 deletions dash-pipeline/SAI/specs/sai_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -485,18 +485,18 @@ port_extenstion: !!python/object:utils.sai_spec.sai_api_extension.SaiApiExtensio
deprecated: false
is_vlan: false
api_groups:
- !inc '/SAI/specs/dash_acl.yaml'
- !inc '/SAI/specs/dash_direction_lookup.yaml'
- !inc '/SAI/specs/dash_eni.yaml'
- !inc '/SAI/specs/dash_ha.yaml'
- !inc '/SAI/specs/dash_inbound_routing.yaml'
- !inc '/SAI/specs/dash_meter.yaml'
- !inc '/SAI/specs/dash_outbound_ca_to_pa.yaml'
- !inc '/SAI/specs/dash_vnet.yaml'
- !inc '/SAI/specs/dash_outbound_routing.yaml'
- !inc '/SAI/specs/dash_pa_validation.yaml'
- !inc '/SAI/specs/route.yaml'
- !inc '/SAI/specs/dash_vip.yaml'
- !inc '/SAI/specs/dash_tunnel.yaml'
- !inc '/SAI/specs/dash_flow.yaml'
- !inc '/SAI/specs/dash_appliance.yaml'
- !inc 'dash_acl.yaml'
- !inc 'dash_direction_lookup.yaml'
- !inc 'dash_eni.yaml'
- !inc 'dash_ha.yaml'
- !inc 'dash_inbound_routing.yaml'
- !inc 'dash_meter.yaml'
- !inc 'dash_outbound_ca_to_pa.yaml'
- !inc 'dash_vnet.yaml'
- !inc 'dash_outbound_routing.yaml'
- !inc 'dash_pa_validation.yaml'
- !inc 'route.yaml'
- !inc 'dash_vip.yaml'
- !inc 'dash_tunnel.yaml'
- !inc 'dash_flow.yaml'
- !inc 'dash_appliance.yaml'
2 changes: 1 addition & 1 deletion dash-pipeline/SAI/utils/sai_spec/sai_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def serialize(self, spec_dir: str):
f.write(yaml.dump(api_group, indent=2, sort_keys=False))

yaml_inc_files.append(
yaml_include.Data(urlpath=sai_api_group_spec_file_path)
yaml_include.Data(urlpath=os.path.relpath(sai_api_group_spec_file_path, spec_dir))
)

api_groups = self.api_groups
Expand Down

0 comments on commit 832b053

Please sign in to comment.