diff --git a/03-day1.md b/03-day1.md index 135ddd62e56c7f74a8e0e1f78d9330490a4d9019..7b189b5771765e218524b4bfeed889f27f082e18 100644 --- a/03-day1.md +++ b/03-day1.md @@ -107,26 +107,41 @@ osm ns-create ... --config-file vars.yaml This section will focus the attention on creating a Proxy charm to configure a workload. -Create a folder for the `samplecharm` in the VNFD directory, and create necessary files: - +Create a folder for the `samplecharm` in the VNFD directory, and create necessary files (use one of the two following ways): + - Given that you are developing in your local machine: + ```bash + mkdir -p charms/samplecharm/ + cd charms/samplecharm/ + mkdir hooks lib mod src + touch src/charm.py + touch actions.yaml metadata.yaml config.yaml + chmod +x src/charm.py + ln -s ../src/charm.py hooks/upgrade-charm + ln -s ../src/charm.py hooks/install + ln -s ../src/charm.py hooks/start + git clone https://github.com/canonical/operator mod/operator + git clone https://github.com/charmed-osm/charms.osm mod/charms.osm + ln -s ../mod/operator/ops lib/ops + ln -s ../mod/charms.osm/charms lib/charms + ``` + - Given that you are developing in a Git repository: + ```bash + mkdir -p charms/samplecharm/ + cd charms/samplecharm/ + mkdir hooks lib mod src + touch src/charm.py + touch actions.yaml metadata.yaml config.yaml + chmod +x src/charm.py + ln -s ../src/charm.py hooks/upgrade-charm + ln -s ../src/charm.py hooks/install + ln -s ../src/charm.py hooks/start + git submodule add https://github.com/canonical/operator mod/operator + git submodule add https://github.com/charmed-osm/charms.osm mod/charms.osm + ln -s ../mod/operator/ops lib/ops + ln -s ../mod/charms.osm/charms lib/charms + ``` > Go to [charms.osm](https://github.com/charmed-osm/charms.osm) if you want to learn more about how to use the charms.osm library. -```bash -mkdir -p charms/samplecharm/ -cd charms/samplecharm/ -mkdir hooks lib mod src -touch src/charm.py -touch actions.yaml metadata.yaml config.yaml -chmod +x src/charm.py -ln -s ../src/charm.py hooks/upgrade-charm -ln -s ../src/charm.py hooks/install -ln -s ../src/charm.py hooks/start -git clone https://github.com/canonical/operator mod/operator -git clone https://github.com/charmed-osm/charms.osm mod/charms.osm -ln -s ../mod/operator/ops lib/ops -ln -s ../mod/charms.osm/charms lib/charms -``` - Include the following high level metadata in `metadata.yaml`: ```yaml